From e171f6f34eeacf35cf7142b4788d43e7d0978546 Mon Sep 17 00:00:00 2001 From: canyonknight Date: Wed, 8 Aug 2012 18:09:51 -0400 Subject: Migrate all DB code to use PDO All DB code currently uses the quickly aging mysql_* functions. These functions are strongly discouraged and may eventually be deprecated. Transition all code to utilize the PDO data access abstraction layer. PDO allows for consistent query code across multiple databases. This could potentially allow for someone to use a database other than MySQL with minimal code changes. All functions and behaviors are reproduced as faithfully as possible with PDO equivalents and some changes in code. Signed-off-by: canyonknight Signed-off-by: Lukas Fleischer --- web/lib/translator.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'web/lib/translator.inc.php') diff --git a/web/lib/translator.inc.php b/web/lib/translator.inc.php index f269b937..382160cc 100644 --- a/web/lib/translator.inc.php +++ b/web/lib/translator.inc.php @@ -96,11 +96,11 @@ function set_lang($dbh=NULL) { $q = "SELECT LangPreference FROM Users, Sessions "; $q.= "WHERE Users.ID = Sessions.UsersID "; $q.= "AND Sessions.SessionID = '"; - $q.= mysql_real_escape_string($_COOKIE["AURSID"])."'"; - $result = db_query($q, $dbh); + $q.= $dbh->quote($_COOKIE["AURSID"]); + $result = $dbh->query($q); if ($result) { - $row = mysql_fetch_array($result); + $row = $result->fetchAll(); $LANG = $row[0]; } $update_cookie = 1; -- cgit v1.2.3-24-g4f1b