On Oct 24, 2009, at 5:34 AM, rogu...@googlemail.com wrote:

Vince Admin Account (2009-10-23 16:01):

On Oct 19, 2009, at 5:13 PM, rogu...@googlemail.com wrote:


The problem with pagelists lies in GlobToPCRE() function in pmwiki.php
and is tracked at http://pmwiki.org/wiki/PITS/01149 . It concerns
exclusion patterns (name=-Page) only.



(:pagelist group=-PmWiki*,-Site*:) works fine here. Doesn't it work for
you? Are you sure you've made the right changes to GlobToPCRE()? The
line with str_replace call looks like this after changing:

$pat = str_replace(array('\\*', '\\?', '\\[', '\\]', '\\^', '\\-'),
                  array('.*',  '.',   '[',   ']',   '^', '-'), $pat);

Well, I think I am sure. I can cut and paste, in case my eyes are too tired. Here is the entire function.
function GlobToPCRE($pat) {
  $pat = preg_quote($pat, '/');
  $pat = str_replace(array('\\*', '\\?', '\\[', '\\]', '\\^', '\\-'),
array('.*', '.', '[', ']', '^', '-'), $pat);
  $excl = array(); $incl = array();
  foreach(preg_split('/,+\s?/', $pat, -1, PREG_SPLIT_NO_EMPTY) as $p) {
    if ($p{0} == '-'  ) $excl[] = '^'.substr($p, 0).'$';
    else $incl[] = "^$p$";
  }
  return array(implode('|', $incl), implode('|', $excl));
}

Some other interesting things I found here. We are running Apple Snow Leopard, PHP 5.3.0 and Apache 2.2.11.
When I tried to test pieces of this code on my web page,  the line
$pat = preg_quote($pat,'\');
gave a syntax error. It worked as in the manual with a few other characters instead of \. I did get it to work as advertised with
$pat = preg_quote($pat,'\\');
I tried that in GlobToPCRE, but it didn't help. So I am confused. But at least I do have the workaround.
             Vince
 
_______________________________________________
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users

Reply via email to