Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
Added a switch to determine whether an Input::setGet() parameter wi…
Browse files Browse the repository at this point in the history
…ll be checked (see #4277)
  • Loading branch information
leofeyer committed Jan 15, 2013
1 parent 6cfa151 commit 774a54b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion system/modules/core/classes/Frontend.php
Expand Up @@ -265,7 +265,7 @@ public static function getPageIdFromUrl()
return false;
}

\Input::setGet($arrFragments[$i], $arrFragments[$i+1]);
\Input::setGet($arrFragments[$i], $arrFragments[$i+1], true);
}

return $arrFragments[0] ?: null;
Expand Down
13 changes: 9 additions & 4 deletions system/modules/core/library/Contao/Input.php
Expand Up @@ -270,10 +270,11 @@ public static function cookie($strKey, $blnDecodeEntities=false)
/**
* Set a $_GET variable
*
* @param string $strKey The variable name
* @param mixed $varValue The variable value
* @param string $strKey The variable name
* @param mixed $varValue The variable value
* @param boolean $blnAddUnused If true, the value usage will be checked
*/
public static function setGet($strKey, $varValue)
public static function setGet($strKey, $varValue, $blnAddUnused=false)
{
$strKey = static::cleanKey($strKey);

Expand All @@ -287,7 +288,11 @@ public static function setGet($strKey, $varValue)
else
{
$_GET[$strKey] = $varValue;
static::$arrUnusedGet[$strKey] = $varValue; // see #4277

if ($blnAddUnused)
{
static::$arrUnusedGet[$strKey] = $varValue; // see #4277
}
}
}

Expand Down

0 comments on commit 774a54b

Please sign in to comment.