phpBB get_magic_quotes_gpc() Abfrage
Verfasst: 22.07.2005 19:22
Code aus der "common.php"... http://www.phpbb.de/doku/xref/nav.html?common.php.html
Meine Frage lautet jetzt, wieso überprüft wird, ob bei den Get-Variablen ein Array übergeben wurde? Die Frage kommt daher, dass sich mir die Frage stellt, inwiefern man sowas überhaupt übergeben kann?
MfG
Code: Alles auswählen
111 //
112 // addslashes to vars if magic_quotes_gpc is off
113 // this is a security precaution to prevent someone
114 // trying to break out of a SQL statement.
115 //
116 if( !get_magic_quotes_gpc() )
117 {
118 if( is_array($HTTP_GET_VARS) )
119 {
120 while( list($k, $v) = each($HTTP_GET_VARS) )
121 {
122 if( is_array($HTTP_GET_VARS[$k]) )
123 {
124 while( list($k2, $v2) = each($HTTP_GET_VARS[$k]) )
125 {
126 $HTTP_GET_VARS[$k][$k2] = addslashes($v2);
127 }
128 @reset($HTTP_GET_VARS[$k]);
129 }
130 else
131 {
132 $HTTP_GET_VARS[$k] = addslashes($v);
133 }
134 }
135 @reset($HTTP_GET_VARS);
136 }
...
MfG