CoreCommunity ExtensionsIncubatorDistributionsTYPO3 4.5 ProjectsTYPO3 4.6 ProjectsTYPO3 4.7 ProjectsTYPO3 6.0 ProjectsTYPO3 6.1 ProjectsTYPO3 6.2 Projects (+)

Bug #39090

goForRedirect has problems with square brackets in URLs

Added by Felix Heller 10 months ago. Updated 2 months ago.

Status:Resolved Start date:2012-07-19
Priority:Must have Due date:
Assignee:Jan Bednarik % Done:

0%

Category:cooluri Spent time: -
Target version:-
Votes: 1 (View)

Description

If the TypoScript option config.redirectOldLinksToNew is set to 1, then CoolURI tries to redirect a URL like www.example.com/index.php?id=1&tx_ttnews[uid]=123 to www.example.com/news/my-blog-entry/. If the URL was encoded and looks like www.example.com/index.php?id=1&tx_ttnews%5Buid%5D=123, CoolURI translates only the parameters without brackets and redirects to www.example.com/news/?tx_ttnews%5Buid%5D=123.

I've already fixed this bug with a small workaround but I don't know if this is the perfect solution:

public function goForRedirect($params, $ref) {
    if (empty($_GET['ADMCMD_prev']) && $GLOBALS['TSFE']->config['config']['tx_cooluri_enable']==1 && $GLOBALS['TSFE']->config['config']['redirectOldLinksToNew']==1 && t3lib_div::getIndpEnv('REQUEST_URI') && (substr(t3lib_div::getIndpEnv('REQUEST_URI'),1,9)=='index.php' || substr(t3lib_div::getIndpEnv('REQUEST_URI'),1,1)=='?')) {
        $ourl = t3lib_div::getIndpEnv('REQUEST_URI');
        $ss = explode('?',$ourl);
        if ($ss[1]) {
            /* Workaround start */
            $ss[1] = strtr($ss[1], array('%5B' => '[', '%5D' => ']'));
            /* Workaround end */
            $pars = Link_Func::convertQuerystringToArray($ss[1]);
    }

This bug occured with CoolURI version 1.0.28.

Associated revisions

Revision 72616
Added by Jan Bednarik 2 months ago

Bug #39090 fix - convert encoded [] when redirecting from old to new

Revision 72616
Added by Jan Bednarik 2 months ago

Bug #39090 fix - convert encoded [] when redirecting from old to new

History

Updated by Jan Bednarik 2 months ago

  • Status changed from New to Resolved

Fixed in SVN, will be part of next release.

Also available in: Atom PDF