includes/dbal.php
changeset 860 c931041e689a
parent 857 f3a5a276208c
child 879 9788f2b7e08a
equal deleted inserted replaced
859:031673c200f5 860:c931041e689a
   820     if(defined('ENANO_CONFIG_FETCHED')) die_semicritical('Database error', $internal_text);
   820     if(defined('ENANO_CONFIG_FETCHED')) die_semicritical('Database error', $internal_text);
   821     else                                   grinding_halt('Database error', $internal_text);
   821     else                                   grinding_halt('Database error', $internal_text);
   822     exit;
   822     exit;
   823   }
   823   }
   824   
   824   
   825   function die_json()
   825   function die_json($loc = false)
   826   {
   826   {
   827     $e = str_replace("\n", "\\n", addslashes(htmlspecialchars(pg_last_error())));
   827     $e = str_replace("\n", "\\n", addslashes(htmlspecialchars(pg_last_error())));
   828     $q = str_replace("\n", "\\n", addslashes($this->latest_query));
   828     $q = str_replace("\n", "\\n", addslashes($this->latest_query));
   829     $loc = ( $loc ) ? addslashes("\n\nDescription or location of error: $loc") : "";
   829     $loc = ( $loc ) ? addslashes("\n\nDescription or location of error: $loc") : "";
   830     $loc .= "\n\nPlease report the full text of this error to the administrator of the site. If you believe that this is a bug with the software, please contact support@enanocms.org.";
   830     $loc .= "\n\nPlease report the full text of this error to the administrator of the site. If you believe that this is a bug with the software, please contact support@enanocms.org.";
  1146     return $n;
  1146     return $n;
  1147   }
  1147   }
  1148   
  1148   
  1149   function escape($str)
  1149   function escape($str)
  1150   {
  1150   {
  1151     $str = pg_escape_string($str);
  1151     $str = pg_escape_string($this->_conn, $str);
  1152     return $str;
  1152     return $str;
  1153   }
  1153   }
  1154   
  1154   
  1155   function free_result($result = false)
  1155   function free_result($result = false)
  1156   {
  1156   {