Re: [patch] livedocs : Allowing entities in titles

From: Date: Sun, 23 May 2004 07:51:30 +0000
Subject: Re: [patch] livedocs : Allowing entities in titles
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969360812@lists.php.net to get a copy of this message
Here's a better patch that solves this issue properly. example with this string : <a>b<b>a</b>r</a> before the first patch, the parser was doing this : * start when an opening tag with an id attribute is matched * seeks to the next closing tag, overwriting any previous grabbed data if there is another opening tag before any closing tag is found * stops with the first closing tag the result was : a with the first patch I corrected the overwriting problem, but didn't notice the problem with the non-matching closing tag, the result was : a b now it's a b c didou Mehdi Achour wrote: > Hi, > > Attached a patch that allows using entities in the titles collected by > mkindex.php. This fix a problem with the french doc where we have this > kind of stuff : > > <title>Migration &php;</title> > > Actually only PHP (the substitution of &php;) is inserted in the database. > > didou > > > ------------------------------------------------------------------------ > > Index: mkindex.php > =================================================================== > RCS file: /repository/livedocs/mkindex.php,v > retrieving revision 1.32 > diff -u -r1.32 mkindex.php > --- mkindex.php 27 Apr 2004 14:43:28 -0000 1.32 > +++ mkindex.php 23 May 2004 06:42:50 -0000 > @@ -99,6 +99,7 @@ > $this->data .= "INSERT INTO idents VALUES ('{$this->last_id}', > {$this->fileid}, '" . sqlite_escape_string(trim($this->cdata)) . > "');"; > > $this->last_id = false; > + $this->cdata = ''; > } > } > > @@ -107,7 +108,7 @@ > //small hack for '&' > $data = str_replace('||amp||', '&', $data); > > - $this->cdata = $data; > + $this->cdata .= ' ' . trim($data); > } > } >

« previous php.doc (#969360812) next »