]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/scripts/public_html/common.php
changelog to -rc-1
[helm.git] / matita / scripts / public_html / common.php
index 0e7962abfae84b2aff4a64c1f9031dc2583e7258..d56c9d40bf5b5d4b1eab1df4afb59737547c4048 100644 (file)
@@ -50,7 +50,7 @@ function printer($q){
 function query($q,$f) {
   $db = mysql_pconnect("localhost","helm");
   mysql_select_db("matita");
-  $q = preg_replace("/\n/"," ",$q);
+  $q = ltrim(rtrim(preg_replace("/\n/"," ",$q)));
   if (!preg_match("/^(select|describe)[^\n;]*;?$/i",$q)) {
     die("Query not allowed!<pre>" . $q . "</pre>");
     return;