@@ -69,26 +69,21 @@ public static function getTranslateInstance()
6969 return $ lt ;
7070 }
7171
72- public static function cool2params ($ params , $ ref )
72+ public static function cool2params ()
7373 {
74- self ::$ pObj = & $ ref ;
74+ /** @var $request \TYPO3\CMS\Core\Http\ServerRequest */
75+ $ request = $ GLOBALS ['TYPO3_REQUEST ' ];
7576
76- if (!empty ($ params ['pObj ' ]->siteScript )) {
77- $ cond = $ params ['pObj ' ]->siteScript && substr ($ params ['pObj ' ]->siteScript , 0 , 9 ) != 'index.php ' && substr ($ params ['pObj ' ]->siteScript , 0 , 1 ) != '? ' ;
78- $ paramsinurl = '/ ' . $ params ['pObj ' ]->siteScript ;
79- \TYPO3 \CMS \Core \Utility \GeneralUtility::devLog ('SITESCRIPT: ' . $ paramsinurl , 'CoolUri ' );
80- } else {
81- $ cond = \TYPO3 \CMS \Core \Utility \GeneralUtility::getIndpEnv ('REQUEST_URI ' ) && substr (\TYPO3 \CMS \Core \Utility \GeneralUtility::getIndpEnv ('REQUEST_URI ' ), 1 , 9 ) != 'index.php ' && substr (\TYPO3 \CMS \Core \Utility \GeneralUtility::getIndpEnv ('REQUEST_URI ' ), 1 , 1 ) != '? ' ;
82- $ paramsinurl = \TYPO3 \CMS \Core \Utility \GeneralUtility::getIndpEnv ('REQUEST_URI ' );
83- \TYPO3 \CMS \Core \Utility \GeneralUtility::devLog ('REQUEST_URI: ' . $ paramsinurl , 'CoolUri ' );
84- }
77+ $ siteScript = $ request ->getAttribute ('normalizedParams ' )->getSiteScript ();
78+
79+ $ paramsinurl = '/ ' . $ siteScript ;
8580
8681 // check if the only param is the same as the TYPO3 site root
8782 if ($ paramsinurl == substr (PATH_site, strlen (preg_replace ('~/$~ ' , '' , $ _SERVER ['DOCUMENT_ROOT ' ])))) {
88- return ;
83+ return false ;
8984 }
9085
91- if ($ cond ) {
86+ if ($ siteScript && substr ( $ siteScript , 0 , 9 ) != ' index.php ' && substr ( $ siteScript , 0 , 1 ) != ' ? ' ) {
9287
9388 $ lt = self ::getTranslateInstance ();
9489
@@ -99,7 +94,7 @@ public static function cool2params($params, $ref)
9994 $ res = $ GLOBALS ['TYPO3_DB ' ]->exec_SELECTquery ('* ' , 'sys_domain ' , 'domainName= ' . $ GLOBALS ['TYPO3_DB ' ]->fullQuoteStr ($ domain , 'sys_domain ' ) . ' AND hidden=0 ' );
10095 $ row = $ GLOBALS ['TYPO3_DB ' ]->sql_fetch_assoc ($ res );
10196 if (!$ row ) {
102- return ; // Domain is not available, so no translation
97+ return false ; // Domain is not available, so no translation
10398 }
10499 if (empty (\Bednarik \Cooluri \Core \Translate::$ conf ->cache ->prefix )) {
105100 if ($ row && !empty ($ row ['redirectTo ' ])) {
@@ -122,18 +117,9 @@ public static function cool2params($params, $ref)
122117 }
123118 }
124119
125- $ pars = $ lt ->cool2params ($ paramsinurl );
126-
127- $ params ['pObj ' ]->id = $ pars ['id ' ];
128- unset($ pars ['id ' ]);
129- $ npars = self ::extractArraysFromParams ($ pars );
130- self ::stripSlashesOnArray ($ npars );
131- $ params ['pObj ' ]->mergingWithGetVars ($ npars );
132-
133- // Re-create QUERY_STRING from Get vars for use with typoLink()
134- $ _SERVER ['QUERY_STRING ' ] = self ::decodeSpURL_createQueryString ($ pars );
135- \TYPO3 \CMS \Core \Utility \GeneralUtility::devLog ('Resolved QS: ' . $ _SERVER ['QUERY_STRING ' ], 'CoolUri ' );
120+ return self ::extractArraysFromParams ($ lt ->cool2params ($ paramsinurl ));
136121 }
122+ return false ;
137123 }
138124
139125 /**
0 commit comments