| 1 |
<?php // $Id: class_wghtml.php,v 1.1 2005/10/09 15:59:51 djnz Exp $ |
<?php // $Id: class_wghtml.php,v 1.1.4.2 2007/02/19 01:45:57 djnz Exp $ |
| 2 |
|
|
| 3 |
class wghtml_page { |
class wghtml_page { |
| 4 |
|
|
| 5 |
function wghtml_page() { |
function wghtml_page() { |
| 6 |
$this->config =& $GLOBALS['wghtml_config']; |
$this->config = $GLOBALS['wghtml_config']; |
| 7 |
} |
} |
| 8 |
|
|
| 9 |
/** |
/** |
| 86 |
} |
} |
| 87 |
|
|
| 88 |
if ( $cache ) { |
if ( $cache ) { |
| 89 |
if ( $this->retrieve_page($this) ) { |
if ( $this->retrieve_page() ) { |
| 90 |
|
|
| 91 |
// page exists in cache, but does it still exist on disk? |
// page exists in cache, but does it still exist on disk? |
| 92 |
if ( !file_exists($_SERVER['DOCUMENT_ROOT'].$decoded_url) ) { |
if ( !file_exists($_SERVER['DOCUMENT_ROOT'].$decoded_url) ) { |
| 162 |
* The parsed HTML. |
* The parsed HTML. |
| 163 |
*/ |
*/ |
| 164 |
function rebase_urls($text) { |
function rebase_urls($text) { |
| 165 |
|
if ( empty($this->config['rebase_urls']) ) { |
| 166 |
|
return $text; |
| 167 |
|
} |
| 168 |
$find = array( |
$find = array( |
| 169 |
'@(<a\\s[^>]*href\\s*=\\s*")([^/\\\\][^":]*")@Umsi', // <a href=... |
'@(<a\\s[^>]*href\\s*=\\s*")([^/\\\\][^":]*")@Umsi', // <a href=... |
| 170 |
'@(<img\\s[^>]*src\\s*=\\s*")([^/\\\\][^":]*")@Umsi', // <img src=... |
'@(<img\\s[^>]*src\\s*=\\s*")([^/\\\\][^":]*")@Umsi', // <img src=... |