mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-03 08:41:39 +09:00
Convert outdated <script language="javascript"> to <script> #2615
This commit is contained in:
parent
e586552b29
commit
385067b005
2 changed files with 5 additions and 2 deletions
|
|
@ -139,7 +139,7 @@ class Context
|
|||
*/
|
||||
private static $_check_patterns = array(
|
||||
'@<(?:\?|%)@' => 'DENY ALL',
|
||||
'@<script\s*?language\s*?=@i' => 'DENY ALL',
|
||||
'@<script\s*?language\s*?=\s*?(?![\'"]javascript[\'"])@i' => 'DENY ALL',
|
||||
'@</?script@i' => 'ALLOW ADMIN ONLY',
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,10 @@ class Utility
|
|||
public static function cleanHeaderAndFooterScripts(string $content)
|
||||
{
|
||||
$content = utf8_clean($content);
|
||||
$content = preg_replace('!</?(html|head|body)[^>]*>!', '', $content);
|
||||
$content = preg_replace('!</?(html|head|body)[^>]*>!i', '', $content);
|
||||
$content = preg_replace_callback('!<script\b([^>]*?)language=[\'"]javascript[\'"]!i', function ($matches) {
|
||||
return trim('<script ' . trim($matches[1]));
|
||||
}, $content);
|
||||
return utf8_trim($content);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue