felogin.patch

felogin Patch - Horst Prote, 2012-05-23 16:30

Download (2.03 KB)

View differences:

felogin/pi1/class.tx_felogin_pi1.php 2012-05-23 16:06:11.680063254 +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
			$extPrefix = substr ( $var[0], 0, strpos ( '[', $var[0] ) );
824
			if ( $extPrefix === FALSE ) $extPrefix = '';
825
			if (stristr($extPrefix,$this->prefixId) === TRUE) continue;
826
			if ($this->conf['preserveGETvars'] == 'all') {
827
				$params .= '&' . $VarString; continue;
828
			}
829
			$varRest = "$var[0]";
830
			while ( $varRest !== FALSE ) {
831
				if ( in_array($varRest, $preserveVars) ) {
832
					$params .= '&' . $VarString; break; }
833
				$varRest = substr ( $varRest, 0, strripos ( $varRest, '[' ) );
831 834
			}
832 835
		}
836

  
833 837
		return $params;
834 838
	}
835 839