[development] PHP input format -> syntax checking
Tadej Baša
tadej.basa at gmail.com
Mon Aug 21 14:46:47 UTC 2006
Robert Wohleb pravi:
> Hi,
>
> As long as the submitted code does not cause a fatal error,
that's exactly what I want to prevent. e.g. a missing ')' (parse error)
in custom block visibility causes the whole site to break.
- Tadej
> you should be able to eval the code with drupal_eval and catch any errors with a
> custom error handler. The trick will be in writing the error handler.
>
> http://api.drupal.org/api/4.7/function/drupal_eval
> http://us3.php.net/manual/en/ref.errorfunc.php
>
> ~Rob
>
> Tadej Baša wrote:
>> Hi,
>> as you know, there is no way to recover from syntax errors in PHP code
>> a user submits (either as nodes or for example in custom block
>> visibility settings). I'm trying to figure out, if it would be
>> possible to send the code to drupal_eval with javascript and prevent
>> form submission if an error is returned.
>> What do you think?
>>
>> -Tadej
>>
>>
>>
>>
>
More information about the development
mailing list