[dokuwiki] Re: Error on save with php5

  • From: Preben Randhol <randhol+dokuwiki@xxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Sat, 07 Oct 2006 11:06:31 +0200

On Sat, 07 Oct 2006 02:19:58 +0100
Chris Smith <chris@xxxxxxxxxxxxx> wrote:

> Preben Randhol wrote:
> > Warning: preg_match() [function.preg-match]: Compilation failed:
> > repeated subpattern is too long at offset 14466
> > in /usr/share/dokuwiki/inc/common.php on line 391

> Hi Preben,
> 
> Please report your dokuwiki version when reporting an error, that 
> enables easy tracking of the line number that is causing your
> problem. Its also best to report bugs to the bugs.splitbrain.org,
> even if it turns out to be something with your configuration.  The
> mailing list is transient where as the bug tracking is permanent.

 dokuwiki 0.0.20060309-5.1

The codeline from common.php

 372   if(version_compare(phpversion(),'4.3.0','<')){
 373     //old versions of PCRE define a maximum of parenthesises even
if no
 374     //backreferences are used - the maximum is 99
 375     //this is very bad performancewise and may even be too high
still
 376     $chunksize = 40;
 377   }else{
 378     //read file in chunks of 600 - this should work around the
 379     //MAX_PATTERN_SIZE in modern PCRE
 380     $chunksize = 400;
 381   }
 382   while($blocks = array_splice($wordblocks,0,$chunksize)){
 383     $re = array();
 384     #build regexp from blocks
 385     foreach($blocks as $block){
 386       $block = preg_replace('/#.*$/','',$block);
 387       $block = trim($block);
 388       if(empty($block)) continue;
 389       $re[]  = $block;
 390     }
 391     if(preg_match('#('.join('|',$re).')#si',$TEXT, $match=array
())) {
 392       return true;
 393     }
 394   }
 395   return false;
 396 }

Preben
-- 
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: