From: short <> Date: Thu, 21 Mar 2002 21:12:13 +0000 (+0000) Subject: Implemented workaround for clients passing arguments with "&" X-Git-Url: https://git.jankratochvil.net/?p=www.energie.vellum.cz.git;a=commitdiff_plain;h=c8e8fc1dba87abf3bf712abf7b5bf8e04c2f4d24;hp=d29a218d327e77156d5da9b98685ea826513d0e8 Implemented workaround for clients passing arguments with "&" +function fixampvars() --- diff --git a/common.php b/common.php index 69ffa30..11ceb6b 100644 --- a/common.php +++ b/common.php @@ -2,6 +2,7 @@ error_reporting(E_ALL); setlocale(LC_ALL,"cs_CZ.iso-8859-2"); + fixampvars(); include("config.php"); @@ -29,6 +30,19 @@ $have_style=!isset($mozilla_major) || $mozilla_major!=4; $have_css=true; // doesn't hurt anybody AFAIK +function fixampvars() +{ + $ars=array("HTTP_GET_VARS","HTTP_POST_VARS"); + foreach ($ars as $ar) { + foreach ($GLOBALS[$ar] as $key=>$val) { + if (substr($key,0,4)!="amp;") + continue; + unset($GLOBALS[$ar][$key]); + $GLOBALS[$ar][substr($key,4)]=$val; + } + } +} + function addpercents($url) { $r=$c="";