2.0.15 -> 2.0.16: QueryString.php failed

Started by t-geronimo, December 30, 2019, 05:15:58 PM

Previous topic - Next topic

t-geronimo


Hello Forum, I have a little problem with the file "./Sources/QueryString.php" .

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


[replace]
// 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>';
},
$buffer
);


The part that the update searches for does not exist in my file
Since I run SMF 2.0.15, my "QueryString.php" is still given with 2.0.9.
Shall I just manually replace the file after running the auto update or shall another method be prefered?

Many thanks for your support!

vbgamer45

You can but that fix is not needed for most people unless you have a custom theme that has not been updated yet.
That's what that code is for to fix older themes missing the hidden input field for login verification.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

t-geronimo

All right, many thanks for your fast support!  :)

Advertisement: