Support for Register globals = off
authorJoey Schulze <joey@infodrom.org>
Sat, 30 Dec 2006 12:39:37 +0000 (12:39 +0000)
committerJoey Schulze <joey@infodrom.org>
Sat, 30 Dec 2006 12:39:37 +0000 (12:39 +0000)
src/Infodrom/events/find.wml

index ade18e5..93c731e 100644 (file)
 
   $where = '';
 
-  if (strlen ($city)) {
+  if (strlen ($_POST[city])) {
     if (strlen ($where)) $where .= "AND ";
-    $where .= sprintf ("city = '%s' ", $city);
+    $where .= sprintf ("city = '%s' ", $_POST[city]);
   }
 
-  if (strlen ($country)) {
+  if (strlen ($_POST[country])) {
     if (strlen ($where)) $where .= "AND ";
-    $where .= sprintf ("country = '%s' ", $country);
+    $where .= sprintf ("country = '%s' ", $_POST[country]);
   }
 
-  if (strlen ($year)) {
+  if (strlen ($_POST[year])) {
     if (strlen ($where)) $where .= "AND ";
-    $where .= sprintf ("( start >= %d AND start < %d ) ", $year, (integer)$year + 1);
+    $where .= sprintf ("( start >= %d AND start < %d ) ", $_POST[year], (integer)$_POST[year] + 1);
   }
 
-  if (strlen ($key)) {
+  if (strlen ($_POST[key])) {
     if (strlen ($where)) $where .= "AND ";
-    if (strlen ($city) || strlen ($country)) {
+    if (strlen ($_POST[city]) || strlen ($_POST[country])) {
       $where = sprintf ("( name ~* '%s' OR url ~* '%s' OR comment ~* '%s' ) ",
-                      addslashes ($key), addslashes ($key), addslashes ($key));
+                      addslashes ($_POST[key]), addslashes ($_POST[key]), addslashes ($_POST[key]));
     } else {
       $where = sprintf ("( name ~* '%s' OR city ~* '%s' OR url ~* '%s' OR comment ~* '%s' ) ",
-                      addslashes ($key), addslashes ($key), addslashes ($key), addslashes ($key));
+                      addslashes ($_POST[key]), addslashes ($_POST[key]), addslashes ($_POST[key]), addslashes ($_POST[key]));
     }
   }
   if (!strlen ($where)) {