[pmwiki-users] Re: search pattern

Jan Peters mail at jan-peters.net
Wed Jul 6 13:31:52 CDT 2005


>> I pruned the code down to
>>
>> <?php  if (!defined('PmWiki')) exit();
>>   Markup('search','_begin','/\(:search *(.+):\)/e',"search('\$1')");
>>
>
> Hmmm, that search pattern is wrong there -- there needs to be
> a '?' after the '+', otherwise the pattern is too greedy and grabs
> much more than just the (:search:) directive.  Try:
>
>     Markup('search','_begin',
>       '/\\(:search\\s*(.+?):\)/e',"search('\$1')");
>
> Also, I think that putting this rule so early in the sequence  
> ('_begin')
> is probably not a good idea -- it might fit better in the 'directives'
> section.

Thanks I modfied it to

  Markup('search','_directives', '/\\(:search\\s*(.+?):\)/e',"search 
('\$1')");

but it still gives me this error:

search string
Warning: Cannot modify header information - headers already sent by  
(output started at /private/Network/Servers/monet/Volumes/monet/ 
jrpeters/Sites/clmc/local/mypublications.php:6) in /private/Network/ 
Servers/monet/Volumes/monet/jrpeters/Sites/clmc/pmwiki.php on line 706

Do you have an idea how to fix that?
Thanks so much!
-Jan



More information about the pmwiki-users mailing list