Now frame-less phpinfo page is valid XML. Part of MDL-7861

This commit is contained in:
stronk7 2007-01-13 20:11:31 +00:00
parent 3facbe6632
commit 629b635dc4

View File

@ -20,8 +20,14 @@
$html = ob_get_contents();
ob_end_clean();
/// Delete styles from output
$html = preg_replace('#(\n?<style[^>]*?>.*?</style[^>]*?>)|(\n?<style[^>]*?/>)#is', '', $html);
$html = preg_replace('#(\n?<head[^>]*?>.*?</head[^>]*?>)|(\n?<head[^>]*?/>)#is', '', $html);
/// Delete DOCTYPE from output
$html = preg_replace('/<!DOCTYPE html PUBLIC.*?>/is', '', $html);
/// Delete body and html tags
$html = preg_replace('/<html.*?>.*?<body.*?>/is', '', $html);
$html = preg_replace('/<\/body><\/html>/is', '', $html);
echo $html;