Index: pdfview.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/pdfview/pdfview.module,v
retrieving revision 1.37.2.4
diff -u -F^f -r1.37.2.4 pdfview.module
--- pdfview.module	4 Feb 2007 13:12:53 -0000	1.37.2.4
+++ pdfview.module	5 Feb 2007 12:36:56 -0000
@@ -248,12 +249,14 @@ function pdfview_check_images($string) {
 
 function _pdfview_rewrite_image_url($matches = array()) {
   $path = $matches[0];
-  $path = str_replace($GLOBALS['base_url'].'/', '', $path);
-  if (base_path() == '/' && $path[0] == '/') { 
-    $path = substr($path, 1);
+  $path = str_replace($GLOBALS['base_url'].'/', '', $path); // removes 'http://www.example.com/'
+  if (base_path() == '/') { // checks if base_path = '/'
+    if ($path[0] == '/') {  // run the following function only if the first sign is '/' and remove it
+      $path = substr($path, 1);
+    }
   }
   else {
-    $path = str_replace(base_path(), '', $path);
+    $path = str_replace(base_path(), '', $path);  // if base_path != '/' we can savely remove base_path
   }
   if (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PRIVATE) {
     $q = variable_get('clean_url', 0) ? '' : '?q=';
