On Wednesday 06 December 2000 20:09, Steve Wainstead wrote:
> Oh yes, I saw that too last night and forgot to report it.
> sw
>
> On Wed, 6 Dec 2000, Jan Hidders wrote:
> > I tried the latest nightly build (December 6) and now I see in my pages
> > things like ³#IF ADMIN³# and ³#IF LOCK³#. But perhaps this is a matter
> > of work in progress?
I cannot verify this. I just downloaded the latest tarball and did a clean
install and cannot find any of this.
It looks like you are using old template files.
Read /templates/README for the new format of ###IF### directives if you use
a custom-modified template.
Otherwise I suggest using the new template files.
/Arno

On Wed, Dec 06, 2000 at 09:30:28PM +0100, Arno Hollosi wrote:
> On Wednesday 06 December 2000 20:09, Steve Wainstead wrote:
> > Oh yes, I saw that too last night and forgot to report it.
> > sw
> >
> > On Wed, 6 Dec 2000, Jan Hidders wrote:
> > > I tried the latest nightly build (December 6) and now I see in my pages
> > > things like ³#IF ADMIN³# and ³#IF LOCK³#. But perhaps this is a matter
> > > of work in progress?
>
> I cannot verify this. I just downloaded the latest tarball and did a clean
> install and cannot find any of this.
I have found the problem. In the function _iftoken in stdlib.php the
removal of line based directives is done with
$page = ereg_replace("{$lineno}[^\n]*\n", '', $page);
and
$page = ereg_replace("{$lineyes}[^\n]*\n", '', $page);
But the brackets around $lineno and $lineyes are wrong. It should be
$page = ereg_replace("${lineno}[^\n]*\n", '', $page);
and
$page = ereg_replace("${lineyes}[^\n]*\n", '', $page);
I don't know why you didn't notice anything. The problem is only visible for
directives that are "false" and are not within a block directive that is
"false". Perhaps you only checked pages where there are no such directives.
-- Jan Hidders

> I have found the problem. In the function _iftoken in stdlib.php the
> removal of line based directives is done with
> But the brackets around $lineno and $lineyes are wrong. It should be
Aha. Are you using PHP3? I'm using PHP4 and the PHP4 manual says to put the
'$' inside the brackets. I guess this is why I cannot see the problem.
Fortunately, PHP4 also accepts the '$' outside the brackets which seems to
be the PHP3 way.
> I don't know why you didn't notice anything. The problem is only visible
> for directives that are "false" and are not within a block directive that
> is "false". Perhaps you only checked pages where there are no such
> directives.
The directives are inside the browse.html template. So the directives occur
on every page. Especially the ###IF ADMIN### stuff.
I've commited your change - thanks for spotting the error.
/Arno