Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Parse the Code? #8

Open
Bert-de-Jong opened this issue Jul 11, 2017 · 0 comments
Open

How to Parse the Code? #8

Bert-de-Jong opened this issue Jul 11, 2017 · 0 comments

Comments

@Bert-de-Jong
Copy link

I think CKEditor is commonly used to allow users to easily create content.
This content is often saved to a database field, and later displayed by a CMS using PHP's echo/print.
Ignoring potential security risks for a moment, this Show Protected plug-in could allow users to include PHP files (with sliders, forms, whatever) anywhere on the page.

However, how can the content be displayed with the PHP code blocks parsed?
I've just discussed this on IRC for hours, and all the solutions I've read about seem problematic.
The only thing I can think of that would actually work is to use file_put_contents() to create a temporary file with the content, then use file_get_contents() to get it back parsed by PHP.
Possibly with eval(), DOM, output buffering, and whatnot.

Unless I'm completely missing something...

@Bert-de-Jong Bert-de-Jong changed the title How to How to Parse the Code? Jul 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant