Date: 06/05/01
- Next message: Maxim Derkachev: "Re: [phplib] Re: odd behaviour when parse()-ing a block"
- Previous message: Kristian Koehntopp: "Re: [phplib] Microsoft..."
- In reply to: Dima Nemchenko: "[phplib] odd behaviour when parse()-ing a block"
- Next in thread: Maxim Derkachev: "Re: [phplib] Re: odd behaviour when parse()-ing a block"
- Reply: Maxim Derkachev: "Re: [phplib] Re: odd behaviour when parse()-ing a block"
- Reply: Dima Nemchenko: "[phplib] Re: odd behaviour when parse()-ing a block"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Dima Nemchenko wrote:
> Hi all,
>
>
> I wonder if anyone has had this same problem and, if so, could explain
> it to me. I'm using PHP Version 4.0.5 and PHPLib 7.2b, though I've
> modified template.inc:
>
> diff -uNr ~/template.inc ~/php/template.inc
> --- /home/myhomepageonline/template.inc Mon Jun 4 14:04:33
> 2001
> +++ /home/myhomepageonline/php/template.inc Mon Jun 4
> 14:02:43 2001
> @@ -106,7 +106,10 @@
> $str = $this->get_var($parent);
> $reg = "/<!--\s+BEGIN $handle\s+-->(.*)<!--\s+END
> $handle\s+-->/sm";
> preg_match_all($reg, $str, $m);
> - $str = preg_replace($reg, "{$name}", $str);
> +# $str = preg_replace($reg, "{$name}", $str);
> +# 2001-05-30, dn <email protected>
> +# q.v.
> http://www.phpbuilder.com/mail/phplib-list/2000071/0108.php
> + $str = preg_replace($reg, "{"."$name}", $str);
> $this->set_var($handle, $m[1][0]);
> $this->set_var($parent, $str);
> }
>
>
> I've got a block in the main template, which is parsed twice, with two
> different templates substituted for the block item. Everything works
> ok, but...
>
> Looking at the source, I see that all the HTML "entities" from the
> second template, like "<" and " l", have been translated into
> "plain" ASCII characters, like "<" and " ". This doesn't happen in the
> first template, or if I parse without appending.
>
> Has anyone else seen this?
>
>
>
> Thanks in advance for all your time,
> --
>
> :D_ima
Hello all,
I've managed to narrow this down somewhat. I've also upgraded to PHPLib
7.2c
The problem occurs because one of the templates has JavaScript code.
There are calls to 'document.write()', and these seem to cause PHPLib to
parse the "<"s and others into ASCII.
What is the recommended way to embed JavaScript in Templates?
Thanks,
--:D_ima Dima Nemchenko <Dima.Nemchenko <email protected>>
"Open source code is like lobster--most people who haven't tried it don't like the way it looks. But those who try it, love it."
- Next message: Maxim Derkachev: "Re: [phplib] Re: odd behaviour when parse()-ing a block"
- Previous message: Kristian Koehntopp: "Re: [phplib] Microsoft..."
- In reply to: Dima Nemchenko: "[phplib] odd behaviour when parse()-ing a block"
- Next in thread: Maxim Derkachev: "Re: [phplib] Re: odd behaviour when parse()-ing a block"
- Reply: Maxim Derkachev: "Re: [phplib] Re: odd behaviour when parse()-ing a block"
- Reply: Dima Nemchenko: "[phplib] Re: odd behaviour when parse()-ing a block"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

