]> git.mjollnir.org Git - moodle.git/commitdiff
Now frame-less phpinfo page is valid XML. Part of MDL-7861
authorstronk7 <stronk7>
Sat, 13 Jan 2007 20:11:31 +0000 (20:11 +0000)
committerstronk7 <stronk7>
Sat, 13 Jan 2007 20:11:31 +0000 (20:11 +0000)
admin/phpinfo.php

index b92c252375c7dd348fcb7c15816a57e9f3ef8065..daf30b2da4eb85bf0539d68f9220c2a932bffb86 100644 (file)
     $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;