|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r65467 - website/public_html/beta/common/code
From: dnljms_at_[hidden]
Date: 2010-09-19 13:39:13
Author: danieljames
Date: 2010-09-19 13:39:12 EDT (Sun, 19 Sep 2010)
New Revision: 65467
URL: http://svn.boost.org/trac/boost/changeset/65467
Log:
Small speed up for the basic filter.
Text files modified:
website/public_html/beta/common/code/boost_filter_basic.php | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
Modified: website/public_html/beta/common/code/boost_filter_basic.php
==============================================================================
--- website/public_html/beta/common/code/boost_filter_basic.php (original)
+++ website/public_html/beta/common/code/boost_filter_basic.php 2010-09-19 13:39:12 EDT (Sun, 19 Sep 2010)
@@ -9,21 +9,20 @@
function basic_filter($params)
{
- $text = remove_html_banner($params['content']);
-
- $is_xhtml = preg_match('@<!DOCTYPE[^>]*xhtml_at_i', $text);
- $tag_end = $is_xhtml ? '/>' : '>';
+ $text = $params['content'];
$match = null;
if(preg_match('@(?:</head>\s*)?<body[^>]*>@is', $text, $match, PREG_OFFSET_CAPTURE)) {
+ $is_xhtml = preg_match('@<!DOCTYPE[^>]*xhtml_at_i', $match[0][0]);
+ $tag_end = $is_xhtml ? '/>' : '>';
+
echo substr($text, 0, $match[0][1]);
echo '<link rel="icon" href="/favicon.ico" type="image/ico"'.$tag_end;
echo '<link rel="stylesheet" type="text/css" href="/style-v2/section-basic.css"'.$tag_end;
echo $match[0][0];
virtual("/common/heading-doc.html");
- echo prepare_html(substr($text, $match[0][1] + strlen($match[0][0])));
-
+ echo prepare_html(remove_html_banner(substr($text, $match[0][1] + strlen($match[0][0]))));
}
else {
echo $text;
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk