diff options
author | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-08-31 08:52:11 +0000 |
---|---|---|
committer | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-08-31 08:52:11 +0000 |
commit | 4c5b53040a9b1df2073b9b0146736e03864849cb (patch) | |
tree | dc0829a8008af2722b4e5a12aab3c70d324bbeb3 | |
parent | e3bf577eb033e85727235385b0ba35638942807b (diff) | |
download | brdo-4c5b53040a9b1df2073b9b0146736e03864849cb.tar.gz brdo-4c5b53040a9b1df2073b9b0146736e03864849cb.tar.bz2 |
#68187 by Zen. Blovk visibity by path checks both aliased and non-aliased paths.
-rw-r--r-- | modules/block/block.module | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/modules/block/block.module b/modules/block/block.module index 579dbcd20..7430312fd 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -668,7 +668,15 @@ function block_list($region) { 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); |