felogin.patch

Horst Prote, 2012-05-25 15:11

Download (2.18 KB)

View differences:

felogin/pi1/class.tx_felogin_pi1.php 2012-05-23 19:28:17.040061721 +0200
812 812
	 protected function getPreserveGetVars() {
813 813

  
814 814
		$params = '';
815
		$preserveVars =! ($this->conf['preserveGETvars'] || $this->conf['preserveGETvars']=='all' ? array() : implode(',', (array)$this->conf['preserveGETvars']));
815
		$preserveVars = !($this->conf['preserveGETvars']) || $this->conf['preserveGETvars']=='all' ? array() : explode ( ',', $this->conf['preserveGETvars']);
816 816
		$getVars = t3lib_div::_GET();
817
		$getVarsString = t3lib_div::implodeArrayForUrl ( '', $getVars, '', TRUE);
818
		$getVarsList = explode ( '&', $getVarsString );
817 819

  
818
		foreach ($getVars as $key => $val) {
819
			if (stristr($key,$this->prefixId) === FALSE) {
820
				if (is_array($val)) {
821
					foreach ($val as $key1 => $val1) {
822
						if ($this->conf['preserveGETvars'] == 'all' || in_array($key . '[' . $key1 .']', $preserveVars)) {
823
							$params .= '&' . $key . '[' . $key1 . ']=' . $val1;
824
						}
825
					}
826
				} else {
827
					if (!in_array($key, array('id','no_cache','logintype','redirect_url','cHash'))) {
828
						$params .= '&' . $key . '=' . $val;
829
					}
830
				}
820
		foreach ($getVarsList as $VarString) {
821
			$var = explode ('=', $VarString);
822
			if (in_array($var[0], array('id','no_cache','logintype','redirect_url','cHash'))) continue;
823
			if ( empty( $var[0] ) ) continue;
824
			$extPrefix = substr ( $var[0], 0, strpos ( '[', $var[0] ) );
825
			if ( $extPrefix === FALSE ) $extPrefix = '';
826
			if (stristr($extPrefix,$this->prefixId) === TRUE) continue;
827
			if ($this->conf['preserveGETvars'] == 'all') {
828
				$params .= '&' . $VarString; continue;
829
			}
830
			$varRest = "$var[0]";
831
			while ( $varRest !== FALSE ) {
832
				if ( in_array($varRest, $preserveVars) ) {
833
					$params .= '&' . $VarString; break; }
834
				$varRest = substr ( $varRest, 0, strripos ( $varRest, '[' ) );
831 835
			}
832 836
		}
837

  
833 838
		return $params;
834 839
	}
835 840

  
......
987 992
	include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/felogin/pi1/class.tx_felogin_pi1.php']);
988 993
}
989 994

  
990
?>
995
?>