bug-global
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PHP: htags: error in html-escaping


From: Shigio Yamaguchi
Subject: Re: PHP: htags: error in html-escaping
Date: Tue, 19 Jul 2005 20:58:08 +0900

> Have found some more issues with htags and PHP:
...
> htags -afFngosx produces (html-output):
> 
> </a><a id="L618" name="L618"> 618                 --&gt;
> </a><a id="L619" name="L619"> 619                 &lt;/script&gt;
> </a><a id="L620" name="L620"> 620                 </a><a
>    name="article_zoom_in" href="javascript:zoom_article();"></a><a
>    id="L621" name="L621"> 621                   &gt;
> </a><a id="L622" name="L622"> 622                 <img alt="zoom"
>    src="../images/other/Lupe-20.gif" style="border: 1px solid black;"
>    ;=""></a>
> <a id="L623" name="L623"> 623                 <img name="article_image"
>    id="article_image" src="$img_FarbGr"></a><a id="L624" name="L624"> 
> 624
>    alt="$alt" width="$width" height="$height"
> </a><a id="L625" name="L625"> 625                     style="border:
>    thin solid black;"
> </a><a id="L626" name="L626"> 626
> </a><a id="L627" name="L627"> 627                     &gt;<!--
>    onLoad="imageLoaded()" -->
> </a><a id="L628" name="L628"> 628
> </a><a id="L629" name="L629"> 629
> 
> After that html-output is not usefull any more, skips lots of lines with 
> code, and eventually does some markup like for keywords, bold...

The cause of error is that htags didn't treat here document(<<<WORD)
correctly. This is the patch for it.
Thank you for your report!

diff -r1.14 php.l
3c3
<  * Copyright (c) 2002, 2004 Tama Communications Corporation
---
>  * Copyright (c) 2002, 2004, 2005 Tama Communications Corporation
54a55,56
> char end_of_here_document[IDENTLEN+1];
> 
67c69
< %start        PHP C_COMMENT CPP_COMMENT SHELL_COMMENT STRING LITERAL 
PREPROCESSOR_LINE
---
> %start        PHP C_COMMENT CPP_COMMENT SHELL_COMMENT STRING LITERAL 
> HEREDOCUMENT PREPROCESSOR_LINE
99a102,115
>  /* Here document */
> <PHP><<<{WORD} {
>               put_string(LEXTEXT);
>               /* extract word and save */
>               if (LEXLENG - 3 > IDENTLEN)
>                       die("Too long name '%s'.", LEXTEXT + 3);
>               strcpy(end_of_here_document, LEXTEXT + 3);
>               yy_push_state(HEREDOCUMENT);
>       }
> <HEREDOCUMENT>^{WORD} {
>               ECHO;
>               if (!strcmp(end_of_here_document, LEXTEXT))
>                       yy_pop_state();
>       }
--
Shigio YAMAGUCHI <address@hidden> - Tama Communications Corporation
PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]