News:

Wondering if this will always be free?  See why free is better.

Main Menu

2.0.15 > 2.0.16 Upgrade issue (another one)

Started by willymmx, May 28, 2020, 11:24:35 AM

Previous topic - Next topic

willymmx

Hi! I have some similar issues, I'm not sure about how to proceed, any suggestion will be helpful:

1) /Sources/Profile-Modify.php
Código: (Encontrar) [Seleccionar]
$sizes = @getimagesize($_FILES['attachment']['tmp_name']);

         // No size, then it's probably not a valid pic.
         // No size, then it's probably not a valid pic.
Código: (Reemplazar) [Seleccionar]
$mime_valid = check_mime_type($_FILES['attachment']['tmp_name'], 'image/', true);
         $sizes = empty($mime_valid) ? false : @getimagesize($_FILES['attachment']['tmp_name']);

         // No size, then it's probably not a valid pic.

2) ./Sources/Register.php
Código: (Encontrar) [Seleccionar]
$context['show_coppa'] = !empty($modSettings['coppaAge']);

   // Under age restrictions?
   if ($context['show_coppa'])
   {
      $context['skip_coppa'] = false;
      $context['coppa_agree_above'] = sprintf($txt['agreement_agree_coppa_above'], $modSettings['coppaAge']);
      $context['coppa_agree_below'] = sprintf($txt['agreement_agree_coppa_below'], $modSettings['coppaAge']);
   }
Código: (Reemplazar) [Seleccionar]
$context['show_coppa'] = !empty($modSettings['coppaAge']);
   $context['require_policy_agreement'] = !empty($modSettings['requirePolicyAgreement']);

   // Under age restrictions?
   if ($context['show_coppa'])
   {
      $context['skip_coppa'] = false;
      $context['coppa_agree_above'] = sprintf($txt['agreement' . ($context['require_policy_agreement'] ? '_policy' : '') . '_agree_coppa_above'], $modSettings['coppaAge']);
      $context['coppa_agree_below'] = sprintf($txt['agreement' . ($context['require_policy_agreement'] ? '_policy' : '') . '_agree_coppa_below'], $modSettings['coppaAge']);
   }

3)   ./Sources/Subs.php
Código: (Encontrar) [Seleccionar]
$context['show_coppa'] = !empty($modSettings['coppaAge']);

   // Under age restrictions?
   if ($context['show_coppa'])
   {
      $context['skip_coppa'] = false;
      $context['coppa_agree_above'] = sprintf($txt['agreement_agree_coppa_above'], $modSettings['coppaAge']);
      $context['coppa_agree_below'] = sprintf($txt['agreement_agree_coppa_below'], $modSettings['coppaAge']);
   }
Código: (Reemplazar) [Seleccionar]
$context['show_coppa'] = !empty($modSettings['coppaAge']);
   $context['require_policy_agreement'] = !empty($modSettings['requirePolicyAgreement']);

   // Under age restrictions?
   if ($context['show_coppa'])
   {
      $context['skip_coppa'] = false;
      $context['coppa_agree_above'] = sprintf($txt['agreement' . ($context['require_policy_agreement'] ? '_policy' : '') . '_agree_coppa_above'], $modSettings['coppaAge']);
      $context['coppa_agree_below'] = sprintf($txt['agreement' . ($context['require_policy_agreement'] ? '_policy' : '') . '_agree_coppa_below'], $modSettings['coppaAge']);
   }

4)   ./Sources/Subs.php
Código: (Encontrar) [Seleccionar]
'content' => '<img src="$1" alt="{alt}"{width}{height} class="bbc_img resized" />',
            'validate' => function (&$tag, &$data, $disabled)
            {
               global $image_proxy_enabled, $image_proxy_secret, $boardurl;

               $data = strtr($data, array('<br>' => ''));
               if (strpos($data, 'http://') !== 0 && strpos($data, 'https://') !== 0)
                  $data = 'http://' . $data;

               if (substr($data, 0, 8) != 'https://' && $image_proxy_enabled)
                  $data = $boardurl . '/proxy.php?request=' . urlencode($data) . '&hash=' . md5($data . $image_proxy_secret);
            },
Código: (Reemplazar) [Seleccionar]
'content' => '<img src="$1" alt="{alt}"{width}{height} class="bbc_img resized" />',
            'validate' => function (&$tag, &$data, $disabled)
            {
               $data = strtr($data, array('<br>' => ''));
               if (strpos($data, 'http://') !== 0 && strpos($data, 'https://') !== 0)
                  $data = 'http://' . $data;

               $data = get_proxied_url($data);
            },


Doug Heffernan

willymmx, what issues are you having as I am not sure I understand what you meant above.

P.s. Long code is best to be posted inside the code tags. It makes for better readibility imo.

Deaks

you also should create your own topic as while you may think its the same their may be a different issue :)
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

willymmx

Quote from: Deaks on May 28, 2020, 12:41:57 PM
you also should create your own topic as while you may think its the same their may be a different issue :)
Ok! no problem.

willymmx

Hi! I have some issues trying to upgrade from 2.0.15 to 2.0.16, I'm not sure about how to proceed, any suggestion will be helpful:

1) /Sources/Profile-Modify.php
Código: (Encontrar) [Seleccionar]
$sizes = @getimagesize($_FILES['attachment']['tmp_name']);

         // No size, then it's probably not a valid pic.
         // No size, then it's probably not a valid pic.
Código: (Reemplazar) [Seleccionar]
$mime_valid = check_mime_type($_FILES['attachment']['tmp_name'], 'image/', true);
         $sizes = empty($mime_valid) ? false : @getimagesize($_FILES['attachment']['tmp_name']);

         // No size, then it's probably not a valid pic.

2) ./Sources/Register.php
Código: (Encontrar) [Seleccionar]
$context['show_coppa'] = !empty($modSettings['coppaAge']);

   // Under age restrictions?
   if ($context['show_coppa'])
   {
      $context['skip_coppa'] = false;
      $context['coppa_agree_above'] = sprintf($txt['agreement_agree_coppa_above'], $modSettings['coppaAge']);
      $context['coppa_agree_below'] = sprintf($txt['agreement_agree_coppa_below'], $modSettings['coppaAge']);
   }
Código: (Reemplazar) [Seleccionar]
$context['show_coppa'] = !empty($modSettings['coppaAge']);
   $context['require_policy_agreement'] = !empty($modSettings['requirePolicyAgreement']);

   // Under age restrictions?
   if ($context['show_coppa'])
   {
      $context['skip_coppa'] = false;
      $context['coppa_agree_above'] = sprintf($txt['agreement' . ($context['require_policy_agreement'] ? '_policy' : '') . '_agree_coppa_above'], $modSettings['coppaAge']);
      $context['coppa_agree_below'] = sprintf($txt['agreement' . ($context['require_policy_agreement'] ? '_policy' : '') . '_agree_coppa_below'], $modSettings['coppaAge']);
   }

3)   ./Sources/Subs.php
Código: (Encontrar) [Seleccionar]
$context['show_coppa'] = !empty($modSettings['coppaAge']);

   // Under age restrictions?
   if ($context['show_coppa'])
   {
      $context['skip_coppa'] = false;
      $context['coppa_agree_above'] = sprintf($txt['agreement_agree_coppa_above'], $modSettings['coppaAge']);
      $context['coppa_agree_below'] = sprintf($txt['agreement_agree_coppa_below'], $modSettings['coppaAge']);
   }
Código: (Reemplazar) [Seleccionar]
$context['show_coppa'] = !empty($modSettings['coppaAge']);
   $context['require_policy_agreement'] = !empty($modSettings['requirePolicyAgreement']);

   // Under age restrictions?
   if ($context['show_coppa'])
   {
      $context['skip_coppa'] = false;
      $context['coppa_agree_above'] = sprintf($txt['agreement' . ($context['require_policy_agreement'] ? '_policy' : '') . '_agree_coppa_above'], $modSettings['coppaAge']);
      $context['coppa_agree_below'] = sprintf($txt['agreement' . ($context['require_policy_agreement'] ? '_policy' : '') . '_agree_coppa_below'], $modSettings['coppaAge']);
   }

4)   ./Sources/Subs.php
Código: (Encontrar) [Seleccionar]
'content' => '<img src="$1" alt="{alt}"{width}{height} class="bbc_img resized" />',
            'validate' => function (&$tag, &$data, $disabled)
            {
               global $image_proxy_enabled, $image_proxy_secret, $boardurl;

               $data = strtr($data, array('<br>' => ''));
               if (strpos($data, 'http://') !== 0 && strpos($data, 'https://') !== 0)
                  $data = 'http://' . $data;

               if (substr($data, 0, 8) != 'https://' && $image_proxy_enabled)
                  $data = $boardurl . '/proxy.php?request=' . urlencode($data) . '&hash=' . md5($data . $image_proxy_secret);
            },
Código: (Reemplazar) [Seleccionar]
'content' => '<img src="$1" alt="{alt}"{width}{height} class="bbc_img resized" />',
            'validate' => function (&$tag, &$data, $disabled)
            {
               $data = strtr($data, array('<br>' => ''));
               if (strpos($data, 'http://') !== 0 && strpos($data, 'https://') !== 0)
                  $data = 'http://' . $data;

               $data = get_proxied_url($data);
            },


Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Doug Heffernan

Quote from: willymmx on May 28, 2020, 12:54:01 PM
Hi! I have some issues trying to upgrade from 2.0.15 to 2.0.16, I'm not sure about how to proceed, any suggestion will be helpful:


Are you getting failed messages? In that case you must apply the code manually for the failed files.

You can also overwrite your forum files with the files from the large upgrade 2.0.17 package, minus the upgrade.php and upgrade sql files.

willymmx


Advertisement: