Index: block.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/panels/content_types/block.inc,v
retrieving revision 1.1.4.2
diff -r1.1.4.2 block.inc
26c26
<   $result = db_query("SELECT pages, visibility FROM {blocks} WHERE module = '%s' AND delta = %d", $block->module, $block->delta);
---
>   $result = db_query("SELECT pages, visibility FROM {blocks} WHERE module = '%s' AND delta = '%s'", $block->module, $block->delta);
31,35c31,35
<       $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));
<     } else {
<       $page_match = drupal_eval($block->pages);
---
>       $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_visibility->pages, '/')) .')$/';
>       $page_match = !($block_visibility->visibility xor preg_match($regexp, $path));
>     } else {
>       $page_match = drupal_eval($block_visibility->pages);
40,41c40,68
< 
<   if ($page_match) {
---
> 
>   //inherit roles permissions
>   $block_roles_results = db_query("SELECT rid from {blocks_roles} where module = '%s' AND delta = '%s'", $block->module, $block->delta);
> 
>   if(db_num_rows($block_roles_results) == 0) {
>     $roles_match = TRUE; //allow to pass, since there are no restrictions
>   } 
>   else {
>     //there are roles to take care of
>     $roles_match = FALSE;
>     global $user;
>     
>     static $user_roles = array();
>     if (!isset($user_roles[$user->uid])) {
>       $user_roles[$user->uid] = array_keys($user->roles);
>     }
>       
>     while ($result = db_fetch_object($block_roles_results)) {
>       //match the first results coming in.  
>       $block_roles[] = $result->rid;  
>     }
>     
>     $inherited_roles = array_intersect($block_roles, $user_roles[$user->uid]);
>     if(count($inherited_roles) > 0) {
>       $roles_match = TRUE; 
>     }
>   }
>   
>   if ($page_match && $roles_match) {
