Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Aiheen aloitti: cpf - helmikuu 14, 2020, 02:10:32 AP

Otsikko: Issue upgrading from 2.0.15 -> 2.0.16
Kirjoitti: cpf - helmikuu 14, 2020, 02:10:32 AP
I'm running into an issue upgrading to 2.0.16.

I found the solution for the double-comment in (I already forgot the filename), but my final error is on Subs.php.  The test errors:


11. Replace ./Sources/Subs.php Test failed
12. Replace ./Sources/Subs.php Test failed


The diff on my Subs.php and Subs.php~ file is:


11c11
<  * @version 2.0.14
---
>  * @version 2.0.13
1271,1281c1271,1275
< '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);
< },
---
> 'validate' => create_function('&$tag, &$data, $disabled', '
> $data = strtr($data, array(\'<br />\' => \'\'));
> if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
> $data = \'http://\' . $data;
> '),
1288,1298c1282,1286
< '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);
< },
---
> 'validate' => create_function('&$tag, &$data, $disabled', '
> $data = strtr($data, array(\'<br />\' => \'\'));
> if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
> $data = \'http://\' . $data;
> '),
1860c1848
< if (!isset($disabled['email']) && filter_var($data, FILTER_VALIDATE_EMAIL) !== false && strpos($data, '[email') === false)
---
> if (!isset($disabled['email']) && strpos($data, '@') !== false && strpos($data, '[email') === false)
3234c3222
< global $user_settings, $smcFunc, $boardurl, $image_proxy_enabled, $image_proxy_secret;
---
> global $user_settings, $smcFunc;
3287c3275
< elseif (substr($user_info['avatar']['url'], 0, 7) == 'http://' || substr($user_info['avatar']['url'], 0, 8) == 'https://')
---
> elseif (substr($user_info['avatar']['url'], 0, 7) == 'http://')
3289,3292c3277
< if (substr($user_info['avatar']['url'], 0, 8) != 'https://' && $image_proxy_enabled)
< $context['user']['avatar']['href'] = $boardurl . '/proxy.php?request=' . urlencode($user_info['avatar']['url']) . '&hash=' . md5($user_info['avatar']['url'] . $image_proxy_secret);
< else
< $context['user']['avatar']['href'] = $user_info['avatar']['url'];
---
> $context['user']['avatar']['href'] = $user_info['avatar']['url'];
3413a3399,3404
>
> // Are we debugging the template/html content?
> if (!isset($_REQUEST['xml']) && isset($_GET['debug']) && !$context['browser']['is_ie'] && !WIRELESS)
> header('Content-Type: application/xhtml+xml');
> elseif (!isset($_REQUEST['xml']) && !WIRELESS)
> header('Content-Type: text/html; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));



How can I fix this?
Otsikko: Re: Issue upgrading from 2.0.15 -> 2.0.16
Kirjoitti: cpf - helmikuu 14, 2020, 10:42:25 AP
Or, if nobody knows, is there harm in me overwriting that file with the *.php~ version?
Otsikko: Re: Issue upgrading from 2.0.15 -> 2.0.16
Kirjoitti: shawnb61 - helmikuu 14, 2020, 10:56:54 AP
That looks like you maybe entered some manual fixes for the proxy in there?  Any manual updates would have to be reversed before applying the patch. 

That doesn't look like it has been altered by a mod.  So I would just copy the corresponding code from a vanilla 2.0.15 file.  That would reverse any manual edits made.
Otsikko: Re: Issue upgrading from 2.0.15 -> 2.0.16
Kirjoitti: cpf - helmikuu 14, 2020, 10:58:07 AP
Lainaus käyttäjältä: shawnb61 - helmikuu 14, 2020, 10:56:54 AP
That looks like you maybe entered some manual fixes for the proxy in there?  Any manual updates would have to be reversed before applying the patch. 

That doesn't look like it has been altered by a mod.  So I would just copy the corresponding code from a vanilla 2.0.15 file.  That would reverse any manual edits made.

So overwrite the file from the tilde version?
Otsikko: Re: Issue upgrading from 2.0.15 -> 2.0.16
Kirjoitti: shawnb61 - helmikuu 14, 2020, 11:40:11 AP
No.  I have no idea what is in your tilde version...

Get a 2.0.15 file & replace the updated portions of code with the 2.0.15 code.   The idea is to remove any manual edits thst were made.

If you have zero mods installed, it would be ok to just copy over the 2.0.15 file.
Otsikko: Re: Issue upgrading from 2.0.15 -> 2.0.16
Kirjoitti: shawnb61 - helmikuu 14, 2020, 11:48:04 AP
Are you doing a 2.0.15 => 2.0.16 patch or a 2.0.13 => 2.0.14 patch?   Your code snippet mentions the latter...
Otsikko: Re: Issue upgrading from 2.0.15 -> 2.0.16
Kirjoitti: cpf - helmikuu 14, 2020, 12:09:13 IP
Lainaus käyttäjältä: shawnb61 - helmikuu 14, 2020, 11:40:11 AP
No.  I have no idea what is in your tilde version...
OK. I was under the impression that the tilde version was the original file. I guess that's not correct.

Lainaa
Get a 2.0.15 file & replace the updated portions of code with the 2.0.15 code.   The idea is to remove any manual edits thst were made.

If you have zero mods installed, it would be ok to just copy over the 2.0.15 file.

OK, I'll go that direction.. thank you!
Otsikko: Re: Issue upgrading from 2.0.15 -> 2.0.16
Kirjoitti: cpf - helmikuu 14, 2020, 12:10:20 IP
Lainaus käyttäjältä: shawnb61 - helmikuu 14, 2020, 11:48:04 AP
Are you doing a 2.0.15 => 2.0.16 patch or a 2.0.13 => 2.0.14 patch?   Your code snippet mentions the latter...

2.0.15 -> 2.0.16

My code snippet was a diff between the current file and it's tilde counterpart.
Otsikko: Re: Issue upgrading from 2.0.15 -> 2.0.16
Kirjoitti: Kindred - helmikuu 14, 2020, 12:40:17 IP
yes. the tilde file is the last saved version before the last edit....

So, you either need a baseline version of the file (which may screw up a bunch of your mods, depending on what is there)
or you can manually make the required changes using human decision making -- the failure is because the code the system is looking for is not an exact match
Otsikko: Re: Issue upgrading from 2.0.15 -> 2.0.16
Kirjoitti: cpf - helmikuu 14, 2020, 03:07:13 IP
Lainaus käyttäjältä: Kindred - helmikuu 14, 2020, 12:40:17 IP
yes. the tilde file is the last saved version before the last edit....

So, you either need a baseline version of the file (which may screw up a bunch of your mods, depending on what is there)
or you can manually make the required changes using human decision making -- the failure is because the code the system is looking for is not an exact match

Understood.  Thank you.
Otsikko: Re: Issue upgrading from 2.0.15 -> 2.0.16
Kirjoitti: cpf - helmikuu 17, 2020, 08:47:20 IP
Replacing the file with the version in the 2.015 upgrade archive worked, as did the subsequent upgrade to 2.0.17.

Thanks!