html_entity_decode segfaults in php 4.3.1 on an empty variable... documented in bug 3508. credit: Eloy & Jose Luis Daz

This commit is contained in:
mjollnir_
2005-06-16 02:57:58 +00:00
parent 61fd69b8ae
commit 61cf7b168b
+3 -2
View File
@@ -2709,8 +2709,9 @@ function add_to_log($courseid, $module, $action, $url='', $info='', $cm=0, $user
$timenow = time();
$info = addslashes($info);
$url = html_entity_decode($url); // for php < 4.3.0 this is defined in moodlelib.php
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
}
if (defined('MDL_PERFDB')) { global $PERF ; $PERF->dbqueries++; $PERF->logwrites++;};