Switch to globally defined routine
authorJoey Schulze <joey@infodrom.org>
Wed, 2 Jan 2002 22:32:03 +0000 (22:32 +0000)
committerJoey Schulze <joey@infodrom.org>
Wed, 2 Jan 2002 22:32:03 +0000 (22:32 +0000)
src/Infodrom/news/update.wml

index 536f49d..7202a09 100644 (file)
@@ -1,23 +1,10 @@
 #include <infodrom.style>
+#include <phptools.inc>
 
 <page func="Infodrom Oldenburg" title="News">
 
+<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");