Skip to content

Commit

Permalink
Fixed #6961: CDbException unbuffered queries active when accessing su…
Browse files Browse the repository at this point in the history
…rvey or db analysis
  • Loading branch information
mennodekker committed Nov 26, 2012
1 parent 87836a6 commit e107984
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions application/controllers/survey/index.php
Expand Up @@ -488,6 +488,7 @@ function sendreq(surveyid)
}
$tkresult = dbExecuteAssoc($tkquery); //Checked
$tokendata = $tkresult->read();
$tkresult->close(); //Close the result in case there are more result rows, we are only interested in one and don't want unbuffered query errors
if (isset($tokendata['validfrom']) && (trim($tokendata['validfrom'])!='' && $tokendata['validfrom']>dateShift(date("Y-m-d H:i:s"), "Y-m-d H:i:s", $timeadjust)) ||
isset($tokendata['validuntil']) && (trim($tokendata['validuntil'])!='' && $tokendata['validuntil']<dateShift(date("Y-m-d H:i:s"), "Y-m-d H:i:s", $timeadjust)))
{
Expand Down
8 changes: 8 additions & 0 deletions application/helpers/database_helper.php
Expand Up @@ -13,6 +13,14 @@
*
* $Id$
*/

/**
*
* @param type $sql
* @param type $inputarr
* @param type $silent
* @return CDbDataReader
*/
function dbExecuteAssoc($sql,$inputarr=false,$silent=true)
{
$error = '';
Expand Down

0 comments on commit e107984

Please sign in to comment.