Un usuario preguntó 👇
Agregue un reemplazo de CURL para la función file_get_contents, de modo que el plugin pueda funcionar incluso en el alojamiento con allow_url_fopen=0
.
Agregué una función pública en class.attachment.php
public function file_get_contents_curl($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set curl to return the data instead of printing it to the browser.
curl_setopt($ch, CURLOPT_URL, $url);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
y cambió la llamada en línea 270 a
$optimized_file = $this->file_get_contents_curl( $optimized_img_url );
(código para la función incorporada file_get_contents_curl aquí)
(@webcraftic)
Hace 2 años, 6 meses
Hola,
Escuché tus consejos e hice los cambios en el plugin.
¡Gracias!
Todo lo mejor, Alex
¿Solucionó tu problema??
0 / 0