Skip to content
Browse files

MDL-20288 add_to_log() - handle empties in a cross-db way. Merged fro…

…m 18_STABLE
  • Loading branch information...
1 parent c3867d3 commit 349442efdaecfa1e1e4a55eba67850aa7022dbed @stronk7 stronk7 committed
Showing with 2 additions and 5 deletions.
  1. +2 −5 lib/datalib.php
View
7 lib/datalib.php
@@ -1931,11 +1931,8 @@ function add_to_log($courseid, $module, $action, $url='', $info='', $cm=0, $user
if (defined('MDL_PERFDB')) { global $PERF ; $PERF->dbqueries++; $PERF->logwrites++;};
- if ($CFG->type = 'oci8po') {
- if (empty($info)) {
- $info = ' ';
- }
- }
+ $info = empty($info) ? sql_empty() : $info; // Use proper empties for each database
+ $url = empty($url) ? sql_empty() : $url;
$sql ='INSERT INTO '. $CFG->prefix .'log (time, userid, course, ip, module, cmid, action, url, info)
VALUES (' . "'$timenow', '$userid', '$courseid', '$REMOTE_ADDR', '$module', '$cm', '$action', '$url', '$info')";

0 comments on commit 349442e

Please sign in to comment.
Something went wrong with that request. Please try again.