phpBB - Exibindo assinatura com a função allow_url_fopen desligada


Muitos servidores têm a opção: allow_url_fopen desligada.

Uma solução rápida é usar o cURL para obter a imagem e verificar o tamanho.

A modificação é a seguinte para solucionar o problema:

ABRA: / includes / message_parser.php

ENCONTRE:
Código:
             if ($stats === false)
             {


DEPOIS ADICIONE:
Código:
                
if (function_exists('curl_exec'))
                {
                   $c_img = curl_init();
                   $c_timeout = 8; //The timeout, in seconds. You may want to change this
                   $c_max_filesize = 64000; //The max file size loaded into memory
                   curl_setopt($c_img, CURLOPT_URL, $in);
                   curl_setopt($c_img, CURLOPT_RETURNTRANSFER, 1);
                   @curl_setopt($c_img, CURLOPT_BUFFERSIZE, $c_max_filesize);
                   curl_setopt($c_img, CURLOPT_CONNECTTIMEOUT, $c_timeout);
                   curl_setopt($c_img, CURLOPT_FOLLOWLOCATION,1);
                   $grabbed_img = @curl_exec($c_img);
                   curl_close($c_img);
                   $stats[0] = $stats[1] = false;
                   if ($grabbed_img)
                   {
                      $grabbed_img = @imagecreatefromstring($grabbed_img);
                      $stats[1] = @imagesy($grabbed_img);
                      $stats[0] = @imagesx($grabbed_img);
                      unset($grabbed_img, $c_img);
                   }
                   if (!$stats[0] || !$stats[1])
                   {
                      $stats = false;
                   }
                }
             }
             if ($stats === false)
             {


Salve o arquivo, e o problema será resolvido. 

¿Fue útil la respuesta?

Imprimir éste Artículo

Artículos Relacionados

Como Alterar Senha do WordPress pelo Aplicativo do cPanel

Aviso Importante: As opções divulgadas no tutorial são ferramentas que temos em nossas...

Como corrigir o erro 500 no Elementor

Tutorial em vídeo: Tutorial em texto: Se você deparou com o erro 500 ao utilizar Elementor, o...

Como migrar o WordPress de diretório

Como Mover a Instalação do WordPress para o Diretório Raiz (public_html) Se você instalou o...