diff options
author | Andrew Dolgov <[email protected]> | 2008-11-10 06:29:19 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2008-11-10 06:29:19 +0100 |
commit | f29ba1484f4a230651a40f4b3e26444d9748453f (patch) | |
tree | 0b8d66229a08600986654a060ad2128b6d07f130 /functions.php | |
parent | d2bf48f90ad1997406708811c45163567b9c3ff0 (diff) |
code cleanup, test for db_escape() crazyness in DB sanity check
Diffstat (limited to 'functions.php')
-rw-r--r-- | functions.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/functions.php b/functions.php index e1f4a229f..48d6e3a85 100644 --- a/functions.php +++ b/functions.php @@ -1980,6 +1980,10 @@ } } + if (db_escape_string("testTEST") != "testTEST") { + $error_code = 12; + } + error_reporting (DEFAULT_ERROR_LEVEL); if ($error_code != 0) { @@ -5843,4 +5847,16 @@ function feed_has_icon($id) { return is_file(ICONS_DIR . "/$id.ico") && filesize(ICONS_DIR . "/$id.ico") > 0; } + + function init_connection($link) { + if (DB_TYPE == "pgsql") { + pg_query("set client_encoding = 'UTF-8'"); + pg_set_client_encoding("UNICODE"); + } else { + if (defined('MYSQL_CHARSET') && MYSQL_CHARSET) { + db_query($link, "SET NAMES " . MYSQL_CHARSET); + // db_query($link, "SET CHARACTER SET " . MYSQL_CHARSET); + } + } + } ?> |