Ensure PHP 5.3 compatibility

This commit is contained in:
Jakub Vrana
2025-03-11 21:43:59 +01:00
parent dc2e945aef
commit 2fdebfda29
6 changed files with 19 additions and 10 deletions

View File

@@ -43,7 +43,10 @@ if (isset($_GET["pgsql"])) {
}
function quote($string) {
return pg_escape_literal($this->link, $string);
return (function_exists('pg_escape_literal')
? pg_escape_literal($this->link, $string) // available since PHP 5.4.4
: "'" . pg_escape_string($this->link, $string) . "'"
);
}
function value($val, $field) {