| 1 |
<?php |
<?php |
| 2 |
// $Id: pdfview.module,v 1.41 2007/01/27 09:07:58 egonbianchet Exp $ |
// $Id: pdfview.module,v 1.42 2007/02/04 13:09:49 egonbianchet Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 247 |
|
|
| 248 |
function _pdfview_rewrite_image_url($matches = array()) { |
function _pdfview_rewrite_image_url($matches = array()) { |
| 249 |
$path = $matches[0]; |
$path = $matches[0]; |
| 250 |
$path = str_replace($GLOBALS['base_url'].'/', '', $path); |
$path = str_replace($GLOBALS['base_url'].'/', '', $path); // removes 'http://www.example.com/' |
| 251 |
if (base_path() == '/' && $path[0] == '/') { |
if (base_path() == '/') { // checks if base_path = '/' |
| 252 |
$path = substr($path, 1); |
if ($path[0] == '/') { // run the following function only if the first sign is '/' and remove it |
| 253 |
|
$path = substr($path, 1); |
| 254 |
|
} |
| 255 |
} |
} |
| 256 |
else { |
else { |
| 257 |
$path = str_replace(base_path(), '', $path); |
$path = str_replace(base_path(), '', $path); // if base_path != '/' we can savely remove base_path |
| 258 |
} |
} |
| 259 |
if (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PRIVATE) { |
if (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PRIVATE) { |
| 260 |
$q = variable_get('clean_url', 0) ? '' : '?q='; |
$q = variable_get('clean_url', 0) ? '' : '?q='; |