]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-14679 fixed datalib addslashes
authorskodak <skodak>
Fri, 30 May 2008 17:00:25 +0000 (17:00 +0000)
committerskodak <skodak>
Fri, 30 May 2008 17:00:25 +0000 (17:00 +0000)
lib/datalib.php

index f33df04920b4dd9e3c03c43c847e07dced36ba80..b23e0d1a7c7aba54d2381fcff3304eff392bd752 100644 (file)
@@ -1830,7 +1830,7 @@ function add_to_log($courseid, $module, $action, $url='', $info='', $cm=0, $user
     $REMOTE_ADDR = getremoteaddr();
 
     $timenow = time();
-    $info = addslashes($info);
+    $info = $info;
     if (!empty($url)) { // could break doing html_entity_decode on an empty var.
         $url = html_entity_decode($url); // for php < 4.3.0 this is defined in moodlelib.php
     }
@@ -1839,22 +1839,18 @@ function add_to_log($courseid, $module, $action, $url='', $info='', $cm=0, $user
     // database so that it doesn't cause a DB error. Log a warning so that
     // developers can avoid doing things which are likely to cause this on a
     // routine basis.
-    $tl=textlib_get_instance();
+    $tl = textlib_get_instance();
     if(!empty($info) && $tl->strlen($info)>255) {
-        $info=$tl->substr($info,0,252).'...';
+        $info = $tl->substr($info,0,252).'...';
         debugging('Warning: logged very long info',DEBUG_DEVELOPER);
     }
-    // Note: Unlike $info, URL appears to be already slashed before this function
-    // is called. Since database limits are for the data before slashes, we need
-    // to remove them...
-    $url=stripslashes($url);
+
     // If the 100 field size is changed, also need to alter print_log in course/lib.php
     if(!empty($url) && $tl->strlen($url)>100) {
         $url=$tl->substr($url,0,97).'...';
         debugging('Warning: logged very long URL',DEBUG_DEVELOPER);
     }
-    $url=addslashes($url);
-
+    
     if (defined('MDL_PERFDB')) { global $PERF ; $PERF->logwrites++;};
 
     if ($CFG->type = 'oci8po') {