- added method qstr() to inc.DBAccess.php and use it class Session

This commit is contained in:
steinm 2011-11-29 07:17:29 +00:00
parent f2e279f4c5
commit c3c1694826
2 changed files with 12 additions and 1 deletions

View File

@ -120,6 +120,17 @@ class LetoDMS_Core_DatabaseAccess {
else return true;
} /* }}} */
/**
* Sanitize String used in database operations
*
* @param string text
* @return string sanitized string
*/
function qstr($text) { /* {{{ */
return $this->_conn->qstr($text);
} /* }}} */
/**
* Execute SQL query and return result
*

View File

@ -66,7 +66,7 @@ class LetoDMS_Session {
* @return boolean true if successful otherwise false
*/
function load($id) { /* {{{ */
$queryStr = "SELECT * FROM tblSessions WHERE id = '".$id."'";
$queryStr = "SELECT * FROM tblSessions WHERE id = ".$this->db->qstr($id)."";
$resArr = $this->db->getResultArray($queryStr);
if (is_bool($resArr) && $resArr == false)
return false;