Index: block.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/block.module,v
retrieving revision 1.206.2.1
diff -u -r1.206.2.1 block.module
--- block.module	21 May 2006 13:49:07 -0000	1.206.2.1
+++ block.module	9 Jun 2006 14:57:51 -0000
@@ -623,7 +623,15 @@
         if ($block->visibility < 2) {
           $path = drupal_get_path_alias($_GET['q']);
           $regexp = '/^('. preg_replace(array('/(\r\n?|\n)/', '/\\\\\*/', '/(^|\|)\\\\<front\\\\>($|\|)/'), array('|', '.*', '\1'. preg_quote(variable_get('site_frontpage', 'node'), '/') .'\2'), preg_quote($block->pages, '/')) .')$/';
-          $page_match = !($block->visibility xor preg_match($regexp, $path));
+          // Compare with the internal and path alias (if any). 
+          $page_match = preg_match($regexp, $path);
+          if ($path != $_GET['q']) {
+            $page_match = $page_match || preg_match($regexp, $_GET['q']);
+          }
+          // When $block->visibility has a value of 0, the block is displayed on
+          // all pages except those listed in $block->pages. When set to 1, it
+          // is displayed only on those pages listed in $block->pages.
+          $page_match = !($block->visibility xor $page_match);
         }
         else {
           $page_match = drupal_eval($block->pages);
