6.0.0-alpha10
5/14/25

[#3037] Horde_Config should validate generated PHP
Summary Horde_Config should validate generated PHP
Queue Horde Framework Packages
Queue Version HEAD
Type Enhancement
State Accepted
Priority 1. Low
Owners
Requester chuck (at) horde (dot) org
Created 11/24/2005 (7111 days ago)
Due
Updated 11/09/2008 (6030 days ago)
Assigned
Resolved
Milestone
Patch No

History
11/09/2008 01:59:41 AM Chuck Hagenbuch State ⇒ Accepted
 
11/16/2006 05:08:25 PM Chuck Hagenbuch State ⇒ Stalled
 
11/24/2005 10:41:40 PM Chuck Hagenbuch Comment #3 Reply to this comment
I already thought about that a few times, but this would only be 
possible with
calling a PHP cli with the -l flag, but how to handle this 
gracefully with the lots of
different places where it can be installed - if it is installed at all?
Well, if we assume that the worst that can happen is a parse error - 
as opposed to a fatal error - we could eval() it. Since we require 
admin access this might not be as bad a security risk as otherwise.
Also, to help achieve more specific error messages, we should add a
new type for PHP code that also validates the individual snippets so
that you can't enter something that's not valid on the right side of
an = expression in one of those fields.
Wouldn't this be covered by the above?
Other way around, really - if we lint the whole file we can't tell the 
user which field the error was in, if we lint each field we can.
11/24/2005 05:14:12 PM Jan Schneider Comment #2 Reply to this comment
We can't catch _everything_, but the validate() method on ConfigForm
should make sure the config file we're going to generate parses
before considering the form valid.
I already thought about that a few times, but this would only be 
possible with calling a PHP cli with the -l flag, but how to handle 
this gracefully with the lots of different places where it can be 
installed - if it is installed at all?
Also, to help achieve more specific error messages, we should add a
new type for PHP code that also validates the individual snippets so
that you can't enter something that's not valid on the right side of
an = expression in one of those fields.
Wouldn't this be covered by the above?
11/24/2005 04:44:01 PM Chuck Hagenbuch Comment #1
State ⇒ Accepted
Priority ⇒ 1. Low
Type ⇒ Enhancement
Summary ⇒ Horde_Config should validate generated PHP
Queue ⇒ Horde Framework Packages
Reply to this comment
We can't catch _everything_, but the validate() method on ConfigForm 
should make sure the config file we're going to generate parses before 
considering the form valid.



Also, to help achieve more specific error messages, we should add a 
new type for PHP code that also validates the individual snippets so 
that you can't enter something that's not valid on the right side of 
an = expression in one of those fields.

Saved Queries