From: stronk7 Date: Thu, 9 Aug 2007 18:17:48 +0000 (+0000) Subject: Fixed insert/update of Oracle xLOBs. Credit goes to Rita Scholes. MDL-9835 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=88cd967851298fde4172ccf4e0eb6d1668bfd44a;p=moodle.git Fixed insert/update of Oracle xLOBs. Credit goes to Rita Scholes. MDL-9835 Merged from MOODLE_18_STABLE --- diff --git a/lib/dmllib.php b/lib/dmllib.php index 0da3d0716d..56a2120059 100644 --- a/lib/dmllib.php +++ b/lib/dmllib.php @@ -2303,6 +2303,11 @@ function db_update_lobs ($table, $sqlcondition, &$clobs, &$blobs) { if (defined('MDL_PERFDB')) { global $PERF ; $PERF->dbqueries++; }; /// Count the extra updates in PERF + /// Oracle CLOBs doesn't like quoted strings (are inserted via prepared statemets) + if ($CFG->dbfamily == 'oracle') { + $value = stripslashes_safe($value); + } + if (!$db->UpdateClob($CFG->prefix.$table, $key, $value, $sqlcondition)) { $status = false; $statement = "UpdateClob('$CFG->prefix$table', '$key', '" . substr($value, 0, 100) . "...', '$sqlcondition')"; @@ -2320,6 +2325,11 @@ function db_update_lobs ($table, $sqlcondition, &$clobs, &$blobs) { if (defined('MDL_PERFDB')) { global $PERF ; $PERF->dbqueries++; }; /// Count the extra updates in PERF + /// Oracle BLOBs doesn't like quoted strings (are inserted via prepared statemets) + if ($CFG->dbfamily == 'oracle') { + $value = stripslashes_safe($value); + } + if(!$db->UpdateBlob($CFG->prefix.$table, $key, $value, $sqlcondition)) { $status = false; $statement = "UpdateBlob('$CFG->prefix$table', '$key', '" . substr($value, 0, 100) . "...', '$sqlcondition')";