| 1 |
<?php |
<?php |
| 2 |
// $Id: block.module,v 1.206.2.3 2006/08/20 11:32:00 killes Exp $ |
// $Id: block.module,v 1.206.2.4 2006/10/18 20:14:42 killes Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 627 |
if ($block->visibility < 2) { |
if ($block->visibility < 2) { |
| 628 |
$path = drupal_get_path_alias($_GET['q']); |
$path = drupal_get_path_alias($_GET['q']); |
| 629 |
$regexp = '/^('. preg_replace(array('/(\r\n?|\n)/', '/\\\\\*/', '/(^|\|)\\\\<front\\\\>($|\|)/'), array('|', '.*', '\1'. preg_quote(variable_get('site_frontpage', 'node'), '/') .'\2'), preg_quote($block->pages, '/')) .')$/'; |
$regexp = '/^('. preg_replace(array('/(\r\n?|\n)/', '/\\\\\*/', '/(^|\|)\\\\<front\\\\>($|\|)/'), array('|', '.*', '\1'. preg_quote(variable_get('site_frontpage', 'node'), '/') .'\2'), preg_quote($block->pages, '/')) .')$/'; |
| 630 |
$page_match = !($block->visibility xor preg_match($regexp, $path)); |
// Compare with the internal and path alias (if any). |
| 631 |
|
$page_match = preg_match($regexp, $path); |
| 632 |
|
if ($path != $_GET['q']) { |
| 633 |
|
$page_match = $page_match || preg_match($regexp, $_GET['q']); |
| 634 |
|
} |
| 635 |
|
// When $block->visibility has a value of 0, the block is displayed on |
| 636 |
|
// all pages except those listed in $block->pages. When set to 1, it |
| 637 |
|
// is displayed only on those pages listed in $block->pages. |
| 638 |
|
$page_match = !($block->visibility xor $page_match); |
| 639 |
} |
} |
| 640 |
else { |
else { |
| 641 |
$page_match = drupal_eval($block->pages); |
$page_match = drupal_eval($block->pages); |