Affects Version/s: 1.8.9, 1.9.5
Environment:Linux i386, RHEL/CentOS 4.7 (PHP 4.3.9, MySQL 4.1.22)
Affected Branches:MOODLE_18_STABLE, MOODLE_19_STABLE
Fixed Branches:MOODLE_18_STABLE, MOODLE_19_STABLE
Forum posts containing regular HTML links to external sites inside the text of the forum posting don't get sent. As far as I can tell it's the anchor tag that confuses some logic in lib/html2text.php (other HTML tags don't make trouble on my site).
How to reproduce:
- write forum posting
- mark word
- use the link button of the HTML editor and link the marked word to an arbitrary site
- start cron.php via webbrowser to see debugging output (or wait 30+ mins)
- posting doesn't get sent to forum subscribers
- looking at the debugging output of cron.php reveals, that the scripts stops during the forum processing stage while trying to send to the 1st subscriber of the forum with the concerning posting
- looking in apache logfile /var/log/httpd/error_log shows that cron.php crashes with the following fatal error:
"PHP Fatal error: Call to a member function on a non-object in /var/www/html/moodledev/lib/html2text.php on line 575"
- in table mdl_forum_posts column 'mailed' is set to '1' for the concerning posting
- removing the link from the posting (via regular editing of the posting), resetting the 'mailed' column to '0' and rerunning cron.php via browser sends the posting to the forum subscribers