//// Merge -> revision 8290

This commit is contained in:
tDidierjean
2011-09-01 09:53:43 +00:00
parent b973c3ef12
commit a7ad178f28
50 changed files with 431 additions and 256 deletions
+17 -1
View File
@@ -366,7 +366,7 @@ class ValidateCore
*/
public static function isCleanHtml($html)
{
$jsEvent = 'onmousedown|onmousemove|onmmouseup|onmouseover|onmouseout|onload|onunload|onfocus|onblur|onchange|onsubmit|ondblclick|onclick|onkeydown|onkeyup|onkeypress|onmouseenter|onmouseleave';
$jsEvent = 'onmousedown|onmousemove|onmmouseup|onmouseover|onmouseout|onload|onunload|onfocus|onblur|onchange|onsubmit|ondblclick|onclick|onkeydown|onkeyup|onkeypress|onmouseenter|onmouseleave|onerror';
return (!preg_match('/<[ \t\n]*script/i', $html) && !preg_match('/<?.*('.$jsEvent.')[ \t\n]*=/i', $html) && !preg_match('/.*script\:/i', $html));
}
@@ -675,6 +675,22 @@ class ValidateCore
return true;
}
public static function isMySQLEngine($engine)
{
return (in_array($engine, array('InnoDB', 'MyISAM')));
}
public static function isUnixName($data)
{
return preg_match('/^[a-z0-9_-]+$/ui', $data);
}
public static function isTablePrefix($data)
{
// Even if "-" is theorically allowed, it will be considered a syntax error if you do not add backquotes (`) around the table name
return preg_match('/^[a-z0-9_]+$/ui', $data);
}
/**
* Check for standard name file validity
*