Index: models/builderror.php
===================================================================
--- models/builderror.php	(revision 1911)
+++ models/builderror.php	(working copy)
@@ -51,30 +51,31 @@
       echo "BuildError::Insert(): BuildId not set<br>";
       return false;    
       }
-    
-    $text = addslashes($this->Text);
-    
+
+    $text = "E'".pdo_real_escape_string($this->Text)."'";
+    $sourcefile = "E'".pdo_real_escape_string($this->SourceFile)."'";
+
     if(strlen($this->PreContext) == 0)
       {
-      $precontext = "NULL";
+      $precontext = "''";
       }   
     else
       {
-      $precontext = "'".addslashes($this->PreContext)."'";
+      $precontext = "E'".pdo_real_escape_string($this->PreContext)."'";
       }
       
     if(strlen($this->PostContext) == 0)
       {
-      $postcontext = "NULL";
+      $postcontext = "''";
       }   
     else
       {
-      $postcontext = "'".addslashes($this->PostContext)."'";
+      $postcontext = "E'".pdo_real_escape_string($this->PostContext)."'";
       }
       
     $query = "INSERT INTO builderror (buildid,type,logline,text,sourcefile,sourceline,precontext,postcontext,repeatcount)
-              VALUES (".qnum($this->BuildId).",".qnum($this->Type).",".qnum($this->LogLine).",'$text','$this->SourceFile',".qnum($this->SourceLine).",
-              ".$precontext.",".$postcontext.",".qnum($this->RepeatCount).")";                     
+              VALUES (".qnum($this->BuildId).",".qnum($this->Type).",".qnum($this->LogLine).",".$text.",".$sourcefile.",".qnum($this->SourceLine).","
+              .$precontext.",".$postcontext.",".qnum($this->RepeatCount).")";
     if(!pdo_query($query))
       {
       add_last_sql_error("BuildError Insert");
