Skip to content

Commit

Permalink
Now frame-less phpinfo page is valid XML. Part of MDL-7861
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Jan 13, 2007
1 parent 3facbe6 commit 629b635
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions admin/phpinfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 629b635

Please sign in to comment.