MDL-31006 fix various notices in PHP54

PHP54 compatibility
This commit is contained in:
Petr Skoda
2012-01-18 01:03:20 +01:00
committed by Eloy Lafuente (stronk7)
parent ae924874d7
commit b85b25ebb8
34 changed files with 71 additions and 17 deletions
+4
View File
@@ -2466,6 +2466,10 @@ class MoodleQuickForm_Rule_Required extends HTML_QuickForm_Rule {
if (is_array($value) && array_key_exists('text', $value)) {
$value = $value['text'];
}
if (is_array($value)) {
// nasty guess - there has to be something in the array, hopefully nobody invents arrays in arrays
$value = implode('', $value);
}
$stripvalues = array(
'#</?(?!img|canvas|hr).*?>#im', // all tags except img, canvas and hr
'#(\xc2|\xa0|\s|&nbsp;)#', //any whitespaces actually