|
Franz Alt
PHP(4) Parse errorJune 27, 2007 06:47AM |
Dear Programmers, dear forum,
Because I get Parse errors in "PHProjekt.com" with the HTMLPurifier library, I downloaded your lastest Version for PHP 4 today and tried to parse with php Version 4.4.7
> find . -name "*.php" -exec php -l {} \; | grep -v "No syntax error"
Output:
I could fix some of this parsing errors, by
I could not get line 63 to 67 in DOMLex.php working.
$this->tokenizeDOM(
$doc->getElementsByTagName('html')->item(0)-> // <html>
getElementsByTagName('body')->item(0)-> // <body>
getElementsByTagName('div')->item(0) // <div>
, $tokens);Any Idea why there are this parsing errors and how to fix them?
Regards Franz
Edited 2 time(s). Last edit at 06/29/2007 12:09AM by Ambush Commander.
|
Re: PHP(4) Parse error June 27, 2007 08:49AM |
Admin Registered: 6 years ago Posts: 2,639 |
Hi, your lint program is being overly aggressive. DOMLex is a bit of PHP5 specific code that HTML Purifier will automatically refrain from including if you're running PHP4. Try running it and things will work fine. (TokenFactory is a similar file)
BTW, PHProjekt's running an out-of-date version... you may want to upgrade it yourself.
HTML Purifier, Standards Compliant HTML Filtering
|
Franz Alt
Re: PHP(4) Parse errorJune 27, 2007 11:33AM |
Thank's for answering so quick!
Unfortunately I don't know a way to make `php -l` less "aggressive".
Is there a way to tell PHP4 not to look at this part of code, since it isn't executed?
E.g. with "IF DEFINED ..." Macros for something like "conditioned compiling" in C or switching diffent Browsers with "Conditional Comments" for Internet Explorer?
|
Re: PHP(4) Parse error June 27, 2007 11:36AM |
Admin Registered: 6 years ago Posts: 2,639 |
|
Franz Alt
Re: PHP(4) Parse errorJune 27, 2007 12:38PM |