#42934 [Opn->Bgs]: Include (string)
| From: | johannes@php.net | Date: | Thu, 11 Oct 2007 23:21:54 +0000 |
| Subject: | #42934 [Opn->Bgs]: Include (string) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-118436@lists.php.net to get a copy of this message | ||
ID: 42934
Updated by: johannes@php.net
Reported By: donato dot f at tiscali dot it
-Status: Open
+Status: Bogus
Bug Type: Feature/Change Request
Operating System: Linux
PHP Version: 4.4.7
New Comment:
That's already possible, check PHP Streams, especially data: but keep
the allow_url_include security flag in mind. But I don't see a benefit
over eval in your example.
Previous Comments:
------------------------------------------------------------------------
[2007-10-11 21:18:13] donato dot f at tiscali dot it
Description:
------------
Scenario:
a database driven CMS, article contents are retrieved from the database
and stored into a string variable.
The output is usually shown using "echo".
If the article contains some php code it is not executed, but printed
on screen.
The alternative is to write the entire article as php code, retrieve it
and then process it using "eval".
An even more complicated variant is to create a temporary file,
containing both xHTML and php code, and then process it using
"include".
It would be extremely useful to have a variant of the "include"
function, that can take as input not just a file path, but a string
variable, containing both xHTML and php code.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42934&edit=1