diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-02-28 06:37:28 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-02-28 06:37:28 +0000 |
commit | c04ff8e02f01691dc2e325efc523e43f3aebaf95 (patch) | |
tree | 8fbdfe90c1bb04b9b8b74500904c09f126430e19 /installer/installer.php | |
parent | ad56995bafffeca89c44b07cb4f25da7b36a1a99 (diff) |
Change the pattern to identify tables that need prefix substitution to
mirror the drupal pattern of using braces {}.
Diffstat (limited to 'installer/installer.php')
-rw-r--r-- | installer/installer.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/installer/installer.php b/installer/installer.php index 9fec1185..9ea551a8 100644 --- a/installer/installer.php +++ b/installer/installer.php @@ -89,7 +89,7 @@ class installer { $password = substr(md5(time() * rand()), 0, 6); $hashed_password = $salt . md5($salt . $password); $sql = self::prepend_prefix($config["prefix"], - "UPDATE `[users]` SET `password` = '$hashed_password' WHERE `id` = 2"); + "UPDATE {users} SET `password` = '$hashed_password' WHERE `id` = 2"); if (mysql_query($sql)) { } else { throw new Exception(mysql_error()); @@ -101,7 +101,7 @@ class installer { static function create_private_key($config) { $key = md5(uniqid(mt_rand(), true)) . md5(uniqid(mt_rand(), true)); $sql = self::prepend_prefix($config["prefix"], - "INSERT INTO `[vars]` VALUES(NULL, 'core', 'private_key', '$key')"); + "INSERT INTO {vars} VALUES(NULL, 'core', 'private_key', '$key')"); if (mysql_query($sql)) { } else { throw new Exception(mysql_error()); @@ -109,6 +109,6 @@ class installer { } static function prepend_prefix($prefix, $sql) { - return preg_replace("#\[([a-zA-Z0-9_]+)\]#", "{$prefix}$1", $sql); + return preg_replace("#{([a-zA-Z0-9_]+)}#", "{$prefix}$1", $sql); } }
\ No newline at end of file |