Simple Machines Community Forum

Archived Boards and Threads... => Archived Boards => Install and Upgrade Help => Aiheen aloitti: Qayyom Ashraf - helmikuu 17, 2011, 02:35:58 AP

Otsikko: Need help for manual editing for Operation #2 in QueryString.php file.
Kirjoitti: Qayyom Ashraf - helmikuu 17, 2011, 02:35:58 AP
Dear Experts:

I need help for manual editing for Operation #2 in QueryString.php file.

As mentioned: http://custom.simplemachines.org/upgrades/index.php?action=upgrade;file=smf_patch_1.0.21_1.1.13.tar.gz;smf_version=1.1.12

Operation #2:
Find:
// Now make absolutely sure it's a number.
$board = (int) $_REQUEST['board'];


Replace With:
// Now make absolutely sure it's a number.
$board = (int) $_REQUEST['board'];
$_REQUEST['start'] = isset($_REQUEST['start']) ? (int) $_REQUEST['start'] : 0;


But due to some other Mods like Pretty URLs I've these lines as:
        // Now make absolutely sure it's a number.
        // Check for pretty board URLs too, and possibly redirect if oldschool queries were used.
        $_REQUEST['board'] = str_replace(array(''', '\\'), array("\x12", ''), $_REQUEST['board']);
        $context['pretty']['query_string']['board'] = $_REQUEST['board'];
        if (is_numeric($_REQUEST['board']))
        {
            $board = (int) $_REQUEST['board'];
            if (!isset($_REQUEST['pretty']))
                $context['pretty']['oldschoolquery'] = true;
        } else {
            $pretty_board_lookup = unserialize($modSettings['pretty_board_lookup']);
            $board = (int) isset($pretty_board_lookup[$_REQUEST['board']]) ? $pretty_board_lookup[$_REQUEST['board']] : 0;



Please help / guide me to edit these lines without any problem.
Otsikko: Re: Need help for manual editing for Operation #2 in QueryString.php file.
Kirjoitti: Illori - helmikuu 17, 2011, 05:40:03 AP
uninstall the pretty urls mods install the upgrade patch then reinstall pretty urls
Otsikko: Re: Need help for manual editing for Operation #2 in QueryString.php file.
Kirjoitti: Qayyom Ashraf - helmikuu 17, 2011, 06:05:26 AP
 :-\ I've already done some manual editing for this upgrade.

Please tell me if there is any way to "Edit" only this one.

Otherwise I've to uninstall this up-gradation and Pretty URLs; manually... :-[   
Otsikko: Re: Need help for manual editing for Operation #2 in QueryString.php file.
Kirjoitti: Dzonny - helmikuu 17, 2011, 09:59:56 AP
Hello there.

This should work:

        // Now make absolutely sure it's a number.
        // Check for pretty board URLs too, and possibly redirect if oldschool queries were used.
        $_REQUEST['board'] = str_replace(array(''', '\\'), array("\x12", ''), $_REQUEST['board']);
        $context['pretty']['query_string']['board'] = $_REQUEST['board'];
        if (is_numeric($_REQUEST['board']))
        {
            $board = (int) $_REQUEST['board'];
$_REQUEST['start'] = isset($_REQUEST['start']) ? (int) $_REQUEST['start'] : 0;
            if (!isset($_REQUEST['pretty']))
                $context['pretty']['oldschoolquery'] = true;
        } else {
            $pretty_board_lookup = unserialize($modSettings['pretty_board_lookup']);
            $board = (int) isset($pretty_board_lookup[$_REQUEST['board']]) ? $pretty_board_lookup[$_REQUEST['board']] : 0;




Let us know if there is any more problems.

Regards.
Otsikko: Re: Need help for manual editing for Operation #2 in QueryString.php file.
Kirjoitti: Qayyom Ashraf - helmikuu 18, 2011, 01:12:20 AP
Thanks "Dzonny"

I've updated as per your instructions, I think It's OK and still working properly.

I'll inform here if I see / feel any problem.

Thanks