Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r60089 - website/public_html/beta/common/code
From: daniel_james_at_[hidden]
Date: 2010-03-03 03:09:11


Author: danieljames
Date: 2010-03-03 03:09:09 EST (Wed, 03 Mar 2010)
New Revision: 60089
URL: http://svn.boost.org/trac/boost/changeset/60089

Log:
Remove some boost logos not in header tables.
Text files modified:
   website/public_html/beta/common/code/boost_archive.php | 13 ++++++++++++-
   1 files changed, 12 insertions(+), 1 deletions(-)

Modified: website/public_html/beta/common/code/boost_archive.php
==============================================================================
--- website/public_html/beta/common/code/boost_archive.php (original)
+++ website/public_html/beta/common/code/boost_archive.php 2010-03-03 03:09:09 EST (Wed, 03 Mar 2010)
@@ -513,6 +513,7 @@
 }
 
 function remove_html_banner($text) {
+
     # nasty code, because (?!fubar) causes an ICE...
     preg_match('@<table[^<>]*>?@i',$text,$table_begin,PREG_OFFSET_CAPTURE);
     preg_match('@</table>@i',$text,$table_end,PREG_OFFSET_CAPTURE);
@@ -520,6 +521,7 @@
         $table_contents_start = $table_begin[0][1] + strlen($table_begin[0][0]);
         $table_contents = substr($text, $table_contents_start,
             $table_end[0][1] - $table_contents_start);
+
         if(strpos($table_contents, 'boost.png') !== FALSE) {
             preg_match('@<td[^<>]*>?([^<]*<(h[12]|p).*?)</td>@is', $table_contents,
                 $table_contents_header, PREG_OFFSET_CAPTURE);
@@ -530,9 +532,18 @@
             $tail = preg_replace('@^\s*<hr\s*/?>\s*@', '', $tail);
                 
             $text = $head.$header.$tail;
+ return $text;
         }
     }
- return $text;
+
+ $parts = preg_split('@(?=<(p|blockquote))@', $text, 2);
+ $header = $parts[0];
+ $content = $parts[1];
+
+ $header = preg_replace('@(<h\d>\s*)<img[^>]*src="(\.\.\/)*boost\.png"[^>]*>@', '$1', $header);
+ $header = preg_replace('@<img[^>]*src="(\.\.\/)*boost\.png"[^>]*>\s*<[hb]r.*?>@', '', $header);
+
+ return $header.$content;
 }
 
 function prepare_themed_html($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