Skip to content
Browse files

html_entity_decode segfaults in php 4.3.1 on an empty variable... doc…

…umented in bug 3508. credit: Eloy & Jose Luis Daz
  • Loading branch information...
1 parent 61fd69b commit 61cf7b168b651b7d30c50dfb2d04ae73915d37eb mjollnir_ committed Jun 16, 2005
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/datalib.php
View
5 lib/datalib.php
@@ -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++;};

0 comments on commit 61cf7b1

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