MDL-11415 fixed our non-standard lang attributes in html purifier

This commit is contained in:
skodak 2007-09-25 14:34:13 +00:00
parent 0352cd2ffa
commit 6510b0f09c
3 changed files with 10 additions and 2 deletions

View File

@ -10,6 +10,10 @@ class HTMLPurifier_AttrDef_Lang extends HTMLPurifier_AttrDef
{
function validate($string, $config, &$context) {
// moodle change - we use special lang strings unfortunatelly
return ereg_replace('[^0-9a-zA-Z_-]', '', $string);
// moodle change end
$string = trim($string);
if (!$string) return false;

View File

@ -7,9 +7,11 @@ class HTMLPurifier_HTMLModule_XMLCommonAttributes extends HTMLPurifier_HTMLModul
var $name = 'XMLCommonAttributes';
var $attr_collections = array(
/* moodle comment - xml:lang breaks our multilang
'Lang' => array(
'xml:lang' => 'LanguageCode',
)
*/
);
}

View File

@ -1,7 +1,9 @@
Description of HTML Purifier v2.1.1 Lite library import into Moodle
Description of HTML Purifier v2.1.2 Lite library import into Moodle
Changes:
* Text.php - added nolink, tex, lang and algebra tags
* HMLTModule/Text.php - added <nolink>, <tex>, <lang> and <algebra> tags
* HMLTModule/XMLCommonAttributes.php - remove xml:lang - needed for multilang
* AttrDef/Lang.php - relaxt lang check - needed for multilang
skodak