Uutiset:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu
Advertisement:

upgrading to smf 2.0.16 and then smf 2.0.17 but getting errors

Aloittaja geminiman, maaliskuu 06, 2020, 10:47:36 AP

« edellinen - seuraava »

geminiman

hi guys just managed to get around to doing some upgrades . i saw that there is a 2.0.16 and now a 2.0.17 to fix issues with 2.0.16 .

anyway the package manger told me there were errors . now one or two were just theme errors and can be ignored as it says IGNORE ERRORS . but the other errors are the problem .i just want a bit of advice on these . ill post the errors here first before i go further .

40.    Execute Modification    ./Sources/QueryString.php    Test failed
      1.    Replace    ./Sources/QueryString.php    Test successful
      2.    Add After    ./Sources/QueryString.php    Test failed


56.    Execute Modification    ./Sources/Subs.php    Test failed

9.    Replace    ./Sources/Subs.php    Test failed
10.    Replace    ./Sources/Subs.php    Test failed

so i just want to know can anyone throw a little light on what these errors are or mean , and is it safe for me to proceed with the upgrade or not . if not how can i fix this error .

thanks in advance for any help guys .

geminiman

ok i think i fixed the first error in /sources/ querystring.php as its now saying IGNORE ERROR .

there is a second error in /sources /querystring.php here it is



Code: (Find) [Select]

$buffer = preg_replace_callback('~"' . preg_quote($scripturl, '/') . '\?((?:board|topic)=[^#"]+?)(#[^"]*?)?"~', 'pathinfo_insert__preg_callback', $buffer);
   }


Code: (Add After) [Select]


   // Be nice and try to inject session tokens into login forms since many older themes don't.
   if ($user_info['is_guest'])
      $buffer = preg_replace_callback(
         '~(<form[^<]+action=login2(.+))</form>~iUs' . (!empty($context['utf8']) ? 'u' : ''),
         function ($m) use ($context)
         {
            $repl = '';
            if (strpos($m[0], $context['session_var']) === false)
               $repl .= '<input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '"/>';

            return $m[1] . $repl . '</form>';



and the next error which is in /sources/subs.php

the error says to find the following


Code: (Find) [Select]

'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);
            },

and then replace it with the following

'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);
            },


i downloaded both files from the host to my laptop and in both of the above instances i used notepad++ to find the part i need to fix , however in both files notepad++ said its not there . so i cant replace or add to whats not there . so what do i do ? .



Shambles


geminiman

hi thanks for the reply i appreciate it . i have been searching and reading . and while im finding threads with similarities to my issues they are different . the main issue is that package manager is asking me to find and replace code that does not exist . if the code was there i could replace or add to it as requested by package manager but its not so i cant .

i read the thread you linked to above . the code mentioned is similar but its not the same as the code in my post above . now it seems tho that while the code i posted differs a bit to the code in the thread that you linked to that as you say simple portal is the issue . i cant edit the code as mentioned above because it doesnt exist . so then i thought if i uninstall simple portal for now that might suffice . so i tried that but im getting errors , im being told by package manager to again find and replace code (in order to uninstall correctly ) and again its code that does not exist .

thanks for your reply .

Kindred

That's the whole point.

The "exact" code is not there -- Almost definitely because a mod changed that section of code.
If the exact code WAS there, the system would not have prompted you with an error.

Because the exact code is not there, you have ot use human intuition and knowledge and apply the desired update to the non-exact code.
https://wiki.simplemachines.org/smf/Error_in_mod_installation
Сл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."

Advertisement: