Bug #36894 » felogin.patch
felogin/pi1/class.tx_felogin_pi1.php 2012-05-23 16:06:11.680063254 +0200 | ||
---|---|---|
protected function getPreserveGetVars() {
|
||
$params = '';
|
||
$preserveVars =! ($this->conf['preserveGETvars'] || $this->conf['preserveGETvars']=='all' ? array() : implode(',', (array)$this->conf['preserveGETvars']));
|
||
$preserveVars = !($this->conf['preserveGETvars']) || $this->conf['preserveGETvars']=='all' ? array() : explode ( ',', $this->conf['preserveGETvars']);
|
||
$getVars = t3lib_div::_GET();
|
||
$getVarsString = t3lib_div::implodeArrayForUrl ( '', $getVars, '', TRUE);
|
||
$getVarsList = explode ( '&', $getVarsString );
|
||
foreach ($getVars as $key => $val) {
|
||
if (stristr($key,$this->prefixId) === FALSE) {
|
||
if (is_array($val)) {
|
||
foreach ($val as $key1 => $val1) {
|
||
if ($this->conf['preserveGETvars'] == 'all' || in_array($key . '[' . $key1 .']', $preserveVars)) {
|
||
$params .= '&' . $key . '[' . $key1 . ']=' . $val1;
|
||
}
|
||
}
|
||
} else {
|
||
if (!in_array($key, array('id','no_cache','logintype','redirect_url','cHash'))) {
|
||
$params .= '&' . $key . '=' . $val;
|
||
}
|
||
}
|
||
foreach ($getVarsList as $VarString) {
|
||
$var = explode ('=', $VarString);
|
||
if (in_array($var[0], array('id','no_cache','logintype','redirect_url','cHash'))) continue;
|
||
$extPrefix = substr ( $var[0], 0, strpos ( '[', $var[0] ) );
|
||
if ( $extPrefix === FALSE ) $extPrefix = '';
|
||
if (stristr($extPrefix,$this->prefixId) === TRUE) continue;
|
||
if ($this->conf['preserveGETvars'] == 'all') {
|
||
$params .= '&' . $VarString; continue;
|
||
}
|
||
$varRest = "$var[0]";
|
||
while ( $varRest !== FALSE ) {
|
||
if ( in_array($varRest, $preserveVars) ) {
|
||
$params .= '&' . $VarString; break; }
|
||
$varRest = substr ( $varRest, 0, strripos ( $varRest, '[' ) );
|
||
}
|
||
}
|
||
return $params;
|
||
}
|
||