|
|
| Participants: |
Anthony Borrow and Francois Marier
|
| Security Level: |
None
|
| Resolved date: |
03/Apr/09
|
| Affected Branches: |
MOODLE_19_STABLE
|
| Fixed Branches: |
MOODLE_18_STABLE, MOODLE_19_STABLE
|
|
I was working with some contrib code which was sending an empty value to html2text.php. As a result, the following notice was produced:
Notice: Uninitialized string offset: 0 in /home/arborrow/Moodle/code/19stable/lib/html2text.php on line 39
I am attaching a diff file that gets around the notice; however, I'm not sure if setting $chr to an empty string is the best thing. But I think verifying that there is something there to work with in $badStr{0} is a good idea.
Peace - Anthony
|
|
Description
|
I was working with some contrib code which was sending an empty value to html2text.php. As a result, the following notice was produced:
Notice: Uninitialized string offset: 0 in /home/arborrow/Moodle/code/19stable/lib/html2text.php on line 39
I am attaching a diff file that gets around the notice; however, I'm not sure if setting $chr to an empty string is the best thing. But I think verifying that there is something there to work with in $badStr{0} is a good idea.
Peace - Anthony |
Show » |
|
1) Why is html2text.php function its own file? Is it just for licensing? Any reason not to include into a standard library (weblib or some other).
2) I generally like to see a default value in the case that one is not provided. Would there be any advantage to setting $badStr = '' or NULL? Similarly in /lib/weblib.php with the html_to_text($html) declaration any advantage to declaring a default value.
Peace - Anthony