Use the systemwide version of sql_prepare
authorJoey Schulze <joey@infodrom.org>
Wed, 15 Nov 2006 14:32:04 +0000 (14:32 +0000)
committerJoey Schulze <joey@infodrom.org>
Wed, 15 Nov 2006 14:32:04 +0000 (14:32 +0000)
src/Infodrom/todo/update.wml

index eb7281b..d5bca53 100644 (file)
@@ -1,23 +1,11 @@
 #include <infodrom.style>
+#include <phptools.inc>
 
 <page func="Infodrom Oldenburg" title="Todo">
 
+<sql_prepare>
 <?
 
-  function sql_prepare ($text)
-  {
-    # Der Himmel ist blau, das Wasser ist klar, die Vögel zwitschern
-    # draußen, doch PHP weigert sich beharrlich, vernünftig zu
-    # arbeiten.
-    #
-    # Problem: Im Form kommt " an, PHP macht daraus freundlicherweise \"
-    #          und schon sind unsere Daten in der SQL-DB kaputt.  Danke
-    # $mytext = ereg_replace ("\\\\", "\\\\", $text);
-    $mytext = ereg_replace ("\\\\\"", "\"", $text);
-    #$mytext = ereg_replace ("'", "\\'", $mytext);
-    return ($mytext);
-  }
-
   $dbh = pg_pconnect ("<dbhost>", "<dbport>", "<dbname>")
         or die("Unable to connect to SQL server");