Page MenuHomeDevCentral

D3783.diff
No OneTemporary

D3783.diff

diff --git a/composer.json b/composer.json
--- a/composer.json
+++ b/composer.json
@@ -17,7 +17,7 @@
}
],
"require": {
- "keruald/database": "0.5.0",
+ "keruald/database": "0.5.2",
"keruald/omnitools": "0.15.0",
"smarty/smarty": "^5.6.0",
"ext-mysqli": "*"
diff --git a/workspaces/composer.json b/workspaces/composer.json
--- a/workspaces/composer.json
+++ b/workspaces/composer.json
@@ -3,7 +3,7 @@
"description": "Core interfaces for Obsidian Workspaces",
"type": "project",
"require": {
- "keruald/database": "0.5.0",
+ "keruald/database": "0.5.2",
"keruald/omnitools": "0.15.0",
"smarty/smarty": "^5.6.0"
},
diff --git a/workspaces/src/includes/GlobalFunctions.php b/workspaces/src/includes/GlobalFunctions.php
--- a/workspaces/src/includes/GlobalFunctions.php
+++ b/workspaces/src/includes/GlobalFunctions.php
@@ -15,9 +15,9 @@
function get_username ($user_id) {
global $db;
- $user_id = $db->sql_escape($user_id);
+ $user_id = $db->escape($user_id);
$sql = 'SELECT username FROM '. TABLE_USERS . " WHERE user_id = '$userid'";
- return $db->sql_query_express($sql, "Can't get username from specified user id");
+ return $db->queryScalar($sql, "Can't get username from specified user id");
}
/**
@@ -29,9 +29,9 @@
function get_userid ($username) {
global $db;
- $username = $db->sql_escape($username);
+ $username = $db->escape($username);
$sql = 'SELECT user_id FROM '. TABLE_USERS . " WHERE username LIKE '$username'";
- return $db->sql_query_express($sql, "Can't get user id from specified username");
+ return $db->queryScalar($sql, "Can't get user id from specified username");
}
/**
diff --git a/workspaces/src/includes/error.php b/workspaces/src/includes/error.php
--- a/workspaces/src/includes/error.php
+++ b/workspaces/src/includes/error.php
@@ -94,7 +94,7 @@
$title = $title ? $title : "SQL error";
//Gets SQL error information
- $sqlError = $db->sql_error();
+ $sqlError = $db->error();
if ($sqlError['message'] != '') {
$text .= "<br />Error n° $sqlError[code]: $sqlError[message]";
}
diff --git a/workspaces/src/includes/login.php b/workspaces/src/includes/login.php
--- a/workspaces/src/includes/login.php
+++ b/workspaces/src/includes/login.php
@@ -20,11 +20,11 @@
if (array_key_exists('LogIn', $_POST)) {
//User have submitted login form
- $username = $db->sql_escape($_POST['username']);
+ $username = $db->escape($_POST['username']);
$sql = "SELECT user_password, user_id FROM " . TABLE_USERS . " WHERE username = '$username'";
- if ( !($result = $db->sql_query($sql)) ) message_die(SQL_ERROR, "Can't get user information", '', __LINE__, __FILE__, $sql);
+ if ( !($result = $db->query($sql)) ) message_die(SQL_ERROR, "Can't get user information", '', __LINE__, __FILE__, $sql);
- if ($row = $db->sql_fetchrow($result)) {
+ if ($row = $db->fetchRow($result)) {
if (!$row['user_password']) {
//No password set
$LoginError = "This account exists but hasn't a password defined. Contact the site administrator.";
diff --git a/workspaces/src/includes/objects/user.php b/workspaces/src/includes/objects/user.php
--- a/workspaces/src/includes/objects/user.php
+++ b/workspaces/src/includes/objects/user.php
@@ -85,8 +85,8 @@
function load_from_database () {
global $db;
$sql = "SELECT * FROM " . TABLE_USERS . " WHERE user_id = '" . $this->id . "'";
- if ( !($result = $db->sql_query($sql)) ) message_die(SQL_ERROR, "Unable to query users", '', __LINE__, __FILE__, $sql);
- if (!$row = $db->sql_fetchrow($result)) {
+ if ( !($result = $db->query($sql)) ) message_die(SQL_ERROR, "Unable to query users", '', __LINE__, __FILE__, $sql);
+ if (!$row = $db->fetchRow($result)) {
$this->lastError = "User unknown: " . $this->id;
return false;
}
@@ -118,22 +118,22 @@
function save_to_database () {
global $db;
- $id = $this->id ? "'" . $db->sql_escape($this->id) . "'" : 'NULL';
- $name = $db->sql_escape($this->name);
- $password = $db->sql_escape($this->password);
+ $id = $this->id ? "'" . $db->escape($this->id) . "'" : 'NULL';
+ $name = $db->escape($this->name);
+ $password = $db->escape($this->password);
$active = $this->active ? 1 : 0;
- $email = $db->sql_escape($this->email);
- $regdate = $this->regdate ? "'" . $db->sql_escape($this->regdate) . "'" : 'NULL';
+ $email = $db->escape($this->email);
+ $regdate = $this->regdate ? "'" . $db->escape($this->regdate) . "'" : 'NULL';
//Updates or inserts
$sql = "REPLACE INTO " . TABLE_USERS . " (`user_id`, `username`, `user_password`, `user_active`, `user_email`, `user_regdate`) VALUES ($id, '$name', '$password', $active, '$email', $regdate)";
- if (!$db->sql_query($sql)) {
+ if (!$db->query($sql)) {
message_die(SQL_ERROR, "Unable to save user", '', __LINE__, __FILE__, $sql);
}
if (!$this->id) {
//Gets new record id value
- $this->id = $db->sql_nextid();
+ $this->id = $db->nextId();
}
}
@@ -145,10 +145,10 @@
if (!$this->id) {
message_die(GENERAL_ERROR, "You're trying to update a record not yet saved in the database");
}
- $id = $db->sql_escape($this->id);
- $value = $db->sql_escape($this->$field);
+ $id = $db->escape($this->id);
+ $value = $db->escape($this->$field);
$sql = "UPDATE " . TABLE_USERS . " SET `$field` = '$value' WHERE user_id = '$id'";
- if (!$db->sql_query($sql)) {
+ if (!$db->query($sql)) {
message_die(SQL_ERROR, "Unable to save $field field", '', __LINE__, __FILE__, $sql);
}
}
@@ -166,10 +166,10 @@
do {
$this->id = mt_rand(2001, 9999);
$sql = "SELECT COUNT(*) FROM " . TABLE_USERS . " WHERE user_id = $this->id";
- if (!$result = $db->sql_query($sql)) {
+ if (!$result = $db->query($sql)) {
message_die(SQL_ERROR, "Can't check if a user id is free", '', __LINE__, __FILE__, $sql);
}
- $row = $db->sql_fetchrow($result);
+ $row = $db->fetchRow($result);
} while ($row[0]);
}
@@ -190,10 +190,10 @@
public static function is_available_login ($login) {
global $db;
$sql = "SELECT COUNT(*) FROM " . TABLE_USERS . " WHERE username = '$login'";
- if (!$result = $db->sql_query($sql)) {
+ if (!$result = $db->query($sql)) {
message_die(SQL_ERROR, "Can't check if the specified login is available", '', __LINE__, __FILE__, $sql);
}
- $row = $db->sql_fetchrow($result);
+ $row = $db->fetchRow($result);
return ($row[0] == 0);
}
@@ -218,11 +218,11 @@
public static function get_user_from_email ($mail) {
global $db;
$sql = "SELECT * FROM " . TABLE_USERS . " WHERE user_email = '$mail'";
- if (!$result = $db->sql_query($sql)) {
+ if (!$result = $db->query($sql)) {
message_die(SQL_ERROR, "Can't get user", '', __LINE__, __FILE__, $sql);
}
- if ($row = $db->sql_fetchrow($result)) {
+ if ($row = $db->fetchRow($result)) {
//E-mail found.
$user = new User();
$user->load_from_row($row);
@@ -247,15 +247,15 @@
public static function getUserFromRemoteIdentity ($authType, $remoteUserId) {
global $db;
- $authType = $db->sql_escape($authType);
- $remoteUserId = $db->sql_escape($remoteUserId);
+ $authType = $db->escape($authType);
+ $remoteUserId = $db->escape($remoteUserId);
$sql = "SELECT user_id FROM " . TABLE_USERS_AUTH . " WHERE "
. "auth_type = '$authType' AND auth_identity = '$remoteUserId'";
- if (!$result = $db->sql_query($sql)) {
+ if (!$result = $db->query($sql)) {
message_die(SQL_ERROR, "Can't get user", '', __LINE__, __FILE__, $sql);
}
- if ($row = $db->sql_fetchrow($result)) {
+ if ($row = $db->fetchRow($result)) {
return User::get($row['user_id']);
}
@@ -270,12 +270,12 @@
* */
public function setRemoteIdentity ($authType, $remoteUserId, $properties = null) {
global $db;
- $authType = $db->sql_escape($authType);
- $remoteUserId = $db->sql_escape($remoteUserId);
- $properties = ($properties === NULL) ? 'NULL' : "'" . $db->sql_escape($properties) . "'";
+ $authType = $db->escape($authType);
+ $remoteUserId = $db->escape($remoteUserId);
+ $properties = ($properties === NULL) ? 'NULL' : "'" . $db->escape($properties) . "'";
$sql = "INSERT INTO " . TABLE_USERS_AUTH . " (auth_type, auth_identity, auth_properties, user_id) "
. "VALUES ('$authType', '$remoteUserId', $properties, $this->id)";
- if (!$db->sql_query($sql)) {
+ if (!$db->query($sql)) {
message_die(SQL_ERROR, "Can't set user remote identity provider information", '', __LINE__, __FILE__, $sql);
}
}
@@ -301,10 +301,10 @@
public function isMemberOfGroup (UserGroup $group) {
global $db;
$sql = "SELECT count(*) FROM users_groups_members WHERE group_id = $group->id AND user_id = $this->id";
- if (!$result = $db->sql_query($sql)) {
+ if (!$result = $db->query($sql)) {
message_die(SQL_ERROR, "Can't determine if the user belongs to the group", '', __LINE__, __FILE__, $sql);
}
- $row = $db->sql_fetchrow($result);
+ $row = $db->fetchRow($result);
return $row[0] == 1;
}
@@ -319,7 +319,7 @@
global $db;
$isAdmin = $isAdmin ? 1 : 0;
$sql = "REPLACE INTO users_groups_members VALUES ($group->id, $this->id, $isAdmin)";
- if (!$db->sql_query($sql)) {
+ if (!$db->query($sql)) {
message_die(SQL_ERROR, "Can't add user to group", '', __LINE__, __FILE__, $sql);
}
}
@@ -355,11 +355,11 @@
*/
public function setPermission ($resourceType, $resourceId, $permissionName, $permissionFlag = 1) {
global $db;
- $resourceType = $db->sql_escape($resourceType);
+ $resourceType = $db->escape($resourceType);
if (!is_numeric($resourceId)) {
throw new Exception("Resource ID must be a positive or null integer, and not $resourceId.");
}
- $permissionName = $db->sql_escape($permissionName);
+ $permissionName = $db->escape($permissionName);
if (!is_numeric($permissionFlag)) {
throw new Exception("Permission flag must be a positive or null integer, and not $permissionFlag.");
}
@@ -372,7 +372,7 @@
('U', $this->id,
'$resourceType', $resourceId,
'$permissionName', $permissionFlag)";
- if (!$db->sql_query($sql)) {
+ if (!$db->query($sql)) {
message_die(SQL_ERROR, "Can't set user permission", '', __LINE__, __FILE__, $sql);
}
}
@@ -386,11 +386,11 @@
public static function get_groups_from_user_id ($user_id) {
global $db;
$sql = "SELECT group_id FROM " . TABLE_UGROUPS_MEMBERS . " WHERE user_id = " . $user_id;
- if (!$result = $db->sql_query($sql)) {
+ if (!$result = $db->query($sql)) {
message_die(SQL_ERROR, "Can't get user groups", '', __LINE__, __FILE__, $sql);
}
$gids = array();
- while ($row = $db->sql_fetchrow($result)) {
+ while ($row = $db->fetchRow($result)) {
$gids[] = $row['group_id'];
}
return $gids;
diff --git a/workspaces/src/includes/objects/usergroup.php b/workspaces/src/includes/objects/usergroup.php
--- a/workspaces/src/includes/objects/usergroup.php
+++ b/workspaces/src/includes/objects/usergroup.php
@@ -63,10 +63,10 @@
*/
function load_from_database () {
global $db;
- $id = $db->sql_escape($this->id);
+ $id = $db->escape($this->id);
$sql = "SELECT * FROM " . TABLE_UGROUPS . " WHERE group_id = '" . $id . "'";
- if (!$result = $db->sql_query($sql)) message_die(SQL_ERROR, "Unable to query users_groups", '', __LINE__, __FILE__, $sql);
- if (!$row = $db->sql_fetchrow($result)) {
+ if (!$result = $db->query($sql)) message_die(SQL_ERROR, "Unable to query users_groups", '', __LINE__, __FILE__, $sql);
+ if (!$row = $db->fetchRow($result)) {
$this->lastError = "UserGroup unknown: " . $this->id;
return false;
}
@@ -82,10 +82,10 @@
*/
public static function fromCode ($code) {
global $db;
- $code = $db->sql_escape($code);
+ $code = $db->escape($code);
$sql = "SELECT * FROM " . TABLE_UGROUPS . " WHERE group_code = '" . $code . "'";
- if (!$result = $db->sql_query($sql)) message_die(SQL_ERROR, "Unable to query group", '', __LINE__, __FILE__, $sql);
- if (!$row = $db->sql_fetchrow($result)) {
+ if (!$result = $db->query($sql)) message_die(SQL_ERROR, "Unable to query group", '', __LINE__, __FILE__, $sql);
+ if (!$row = $db->fetchRow($result)) {
throw new Exception("Group unknown: " . $code);
}
@@ -100,20 +100,20 @@
function save_to_database () {
global $db;
- $id = $this->id ? "'" . $db->sql_escape($this->id) . "'" : 'NULL';
- $code = $db->sql_escape($this->code);
- $title = $db->sql_escape($this->title);
- $description = $db->sql_escape($this->description);
+ $id = $this->id ? "'" . $db->escape($this->id) . "'" : 'NULL';
+ $code = $db->escape($this->code);
+ $title = $db->escape($this->title);
+ $description = $db->escape($this->description);
//Updates or inserts
$sql = "REPLACE INTO " . TABLE_UGROUPS . " (`group_id`, `group_code`, `group_title`, `group_description`) VALUES ('$id', '$code', '$title', '$description')";
- if (!$db->sql_query($sql)) {
+ if (!$db->query($sql)) {
message_die(SQL_ERROR, "Unable to save", '', __LINE__, __FILE__, $sql);
}
if (!$this->id) {
//Gets new record id value
- $this->id = $db->sql_nextid();
+ $this->id = $db->nextId();
}
}
}
diff --git a/workspaces/src/includes/session.php b/workspaces/src/includes/session.php
--- a/workspaces/src/includes/session.php
+++ b/workspaces/src/includes/session.php
@@ -98,15 +98,15 @@
$onlineDuration = array_key_exists('OnlineDuration', $Config) ? $Config['OnlineDuration'] : 300;
$sessionDuration = array_key_exists('SessionDuration', $Config) ? $Config['SessionDuration'] : 7200;
- $resource = array_key_exists('ResourceID', $Config) ? '\'' . $db->sql_escape($Config['ResourceID']) . '\'' : 'default';
+ $resource = array_key_exists('ResourceID', $Config) ? '\'' . $db->escape($Config['ResourceID']) . '\'' : 'default';
//Deletes expired sessions
$sql = "DELETE FROM " . TABLE_SESSIONS . " WHERE session_resource = $resource AND TIMESTAMPDIFF(SECOND, session_updated, NOW()) > $sessionDuration";
- if (!$db->sql_query($sql)) message_die(SQL_ERROR, "Can't delete expired sessions", '', __LINE__, __FILE__, $sql);
+ if (!$db->query($sql)) message_die(SQL_ERROR, "Can't delete expired sessions", '', __LINE__, __FILE__, $sql);
//Online -> offline
$sql = "UPDATE " . TABLE_SESSIONS . " SET session_resource = $resource AND session_online = 0 WHERE TIMESTAMPDIFF(SECOND, session_updated, NOW()) > $onlineDuration";
- if (!$db->sql_query($sql)) message_die(SQL_ERROR, 'Can\'t update sessions online statuses', '', __LINE__, __FILE__, $sql);
+ if (!$db->query($sql)) message_die(SQL_ERROR, 'Can\'t update sessions online statuses', '', __LINE__, __FILE__, $sql);
}
@@ -124,11 +124,11 @@
//Saves session in database.
//If the session already exists, it updates the field online and updated.
- $id = $db->sql_escape($this->id);
- $resource = array_key_exists('ResourceID', $Config) ? '\'' . $db->sql_escape($Config['ResourceID']) . '\'' : 'default';
- $user_id = $db->sql_escape(ANONYMOUS_USER);
+ $id = $db->escape($this->id);
+ $resource = array_key_exists('ResourceID', $Config) ? '\'' . $db->escape($Config['ResourceID']) . '\'' : 'default';
+ $user_id = $db->escape(ANONYMOUS_USER);
$sql = "INSERT INTO " . TABLE_SESSIONS . " (session_id, session_ip, session_resource, user_id) VALUES ('$id', '$this->ip', $resource, '$user_id') ON DUPLICATE KEY UPDATE session_online = 1";
- if (!$db->sql_query($sql)) message_die(SQL_ERROR, 'Can\'t save current session', '', __LINE__, __FILE__, $sql);
+ if (!$db->query($sql)) message_die(SQL_ERROR, 'Can\'t save current session', '', __LINE__, __FILE__, $sql);
}
/**
@@ -144,9 +144,9 @@
//Queries sessions table
global $db, $Config;
- $resource = array_key_exists('ResourceID', $Config) ? '\'' . $db->sql_escape($Config['ResourceID']) . '\'' : 'default';
+ $resource = array_key_exists('ResourceID', $Config) ? '\'' . $db->escape($Config['ResourceID']) . '\'' : 'default';
$sql = "SELECT count(*) FROM " . TABLE_SESSIONS . " WHERE session_resource = $resource AND session_online = 1";
- $count = (int)$db->sql_query_express($sql, "Can't count online users");
+ $count = (int)$db->queryScalar($sql, "Can't count online users");
}
//Returns number of users online
@@ -162,9 +162,9 @@
public function get_info ($info) {
global $db;
- $id = $db->sql_escape($this->id);
+ $id = $db->escape($this->id);
$sql = "SELECT `$info` FROM " . TABLE_SESSIONS . " WHERE session_id = '$id'";
- return $db->sql_query_express($sql, "Can't get session $info info");
+ return $db->queryScalar($sql, "Can't get session $info info");
}
/**
@@ -176,10 +176,10 @@
public function set_info ($info, $value) {
global $db;
- $value = ($value === null) ? 'NULL' : "'" . $db->sql_escape($value) . "'";
- $id = $db->sql_escape($this->id);
+ $value = ($value === null) ? 'NULL' : "'" . $db->escape($value) . "'";
+ $id = $db->escape($this->id);
$sql = "UPDATE " . TABLE_SESSIONS . " SET `$info` = $value WHERE session_id = '$id'";
- if (!$db->sql_query($sql))
+ if (!$db->query($sql))
message_die(SQL_ERROR, "Can't set session $info info", '', __LINE__, __FILE__, $sql);
}
@@ -192,11 +192,11 @@
global $db;
//Gets session information
- $id = $db->sql_escape($this->id);
+ $id = $db->escape($this->id);
$sql = "SELECT * FROM " . TABLE_SESSIONS . " WHERE session_id = '$id'";
- if (!$result = $db->sql_query($sql))
+ if (!$result = $db->query($sql))
message_die(SQL_ERROR, "Can't query session information", '', __LINE__, __FILE__, $sql);
- $row = $db->sql_fetchrow($result);
+ $row = $db->fetchRow($result);
//Gets user instance
require_once('includes/objects/user.php');
@@ -230,10 +230,10 @@
global $db;
//Sets specified user ID in sessions table
- $user_id = $db->sql_escape($user_id);
- $id = $db->sql_escape($this->id);
+ $user_id = $db->escape($user_id);
+ $id = $db->escape($this->id);
$sql = "UPDATE " . TABLE_SESSIONS . " SET user_id = '$user_id' WHERE session_id = '$id'";
- if (!$db->sql_query($sql))
+ if (!$db->query($sql))
message_die(SQL_ERROR, "Can't set logged in status", '', __LINE__, __FILE__, $sql);
}
@@ -244,10 +244,10 @@
global $db;
//Sets anonymous user in sessions table
- $user_id = $db->sql_escape(ANONYMOUS_USER);
- $id = $db->sql_escape($this->id);
+ $user_id = $db->escape(ANONYMOUS_USER);
+ $id = $db->escape($this->id);
$sql = "UPDATE " . TABLE_SESSIONS . " SET user_id = '$user_id' WHERE session_id = '$id'";
- if (!$db->sql_query($sql))
+ if (!$db->query($sql))
message_die(SQL_ERROR, "Can't set logged out status", '', __LINE__, __FILE__, $sql);
//Cleans session
diff --git a/workspaces/src/includes/workspaces/Workspace.php b/workspaces/src/includes/workspaces/Workspace.php
--- a/workspaces/src/includes/workspaces/Workspace.php
+++ b/workspaces/src/includes/workspaces/Workspace.php
@@ -74,10 +74,10 @@
*/
public static function fromCode ($code) {
global $db;
- $code = $db->sql_escape($code);
+ $code = $db->escape($code);
$sql = "SELECT * FROM " . TABLE_WORKSPACES . " WHERE workspace_code = '" . $code . "'";
- if (!$result = $db->sql_query($sql)) message_die(SQL_ERROR, "Unable to query workspaces", '', __LINE__, __FILE__, $sql);
- if (!$row = $db->sql_fetchrow($result)) {
+ if (!$result = $db->query($sql)) message_die(SQL_ERROR, "Unable to query workspaces", '', __LINE__, __FILE__, $sql);
+ if (!$row = $db->fetchRow($result)) {
throw new Exception("Workspace unknown: " . $code);
}
@@ -91,10 +91,10 @@
*/
function load_from_database () {
global $db;
- $id = $db->sql_escape($this->id);
+ $id = $db->escape($this->id);
$sql = "SELECT * FROM " . TABLE_WORKSPACES . " WHERE workspace_id = '" . $id . "'";
- if (!$result = $db->sql_query($sql)) message_die(SQL_ERROR, "Unable to query workspaces", '', __LINE__, __FILE__, $sql);
- if (!$row = $db->sql_fetchrow($result)) {
+ if (!$result = $db->query($sql)) message_die(SQL_ERROR, "Unable to query workspaces", '', __LINE__, __FILE__, $sql);
+ if (!$row = $db->fetchRow($result)) {
$this->lastError = "Workspace unknown: " . $this->id;
return false;
}
@@ -108,21 +108,21 @@
function save_to_database () {
global $db;
- $id = $this->id ? "'" . $db->sql_escape($this->id) . "'" : 'NULL';
- $code = $db->sql_escape($this->code);
- $name = $db->sql_escape($this->name);
- $created = $db->sql_escape($this->created);
- $description = $db->sql_escape($this->description);
+ $id = $this->id ? "'" . $db->escape($this->id) . "'" : 'NULL';
+ $code = $db->escape($this->code);
+ $name = $db->escape($this->name);
+ $created = $db->escape($this->created);
+ $description = $db->escape($this->description);
//Updates or inserts
$sql = "REPLACE INTO " . TABLE_WORKSPACES . " (`workspace_id`, `workspace_code`, `workspace_name`, `workspace_created`, `workspace_description`) VALUES ('$id', '$code', '$name', '$created', '$description')";
- if (!$db->sql_query($sql)) {
+ if (!$db->query($sql)) {
message_die(SQL_ERROR, "Unable to save", '', __LINE__, __FILE__, $sql);
}
if (!$this->id) {
//Gets new record id value
- $this->id = $db->sql_nextid();
+ $this->id = $db->nextId();
}
}
@@ -183,13 +183,13 @@
p.permission_name = 'accessLevel' AND
p.permission_flag > 0 AND
($clause)";
- if (!$result = $db->sql_query($sql)) {
+ if (!$result = $db->query($sql)) {
message_die(SQL_ERROR, "Can't get user workspaces", '', __LINE__, __FILE__, $sql);
}
$workspaces = array();
- while ($row = $db->sql_fetchrow($result)) {
+ while ($row = $db->fetchRow($result)) {
$workspace = new Workspace();
$workspace->id = $row['workspace_id'];
$workspace->load_from_row($row);
@@ -211,12 +211,12 @@
public static function is_workspace ($code) {
global $db;
- $code = $db->sql_escape($code);
+ $code = $db->escape($code);
$sql = "SELECT count(*) FROM " . TABLE_WORKSPACES . " WHERE workspace_code = '$code'";
- if (!$result = $db->sql_query($sql)) {
+ if (!$result = $db->query($sql)) {
message_die(SQL_ERROR, "Can't check workspace code", '', __LINE__, __FILE__, $sql);
}
- $row = $db->sql_fetchrow($result);
+ $row = $db->fetchRow($result);
return ($row[0] == 1);
}
}

File Metadata

Mime Type
text/plain
Expires
Thu, Oct 23, 07:47 (13 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3098234
Default Alt Text
D3783.diff (24 KB)

Event Timeline