WordPress.org

Ready to get started?Download WordPress

Forums

Post Snippets
[resolved] error with php code (2 posts)

  1. rfmcomposer
    Member
    Posted 2 years ago #

    Hi,

    Thanks for this wonderful plugin!

    I have one problem though when I enter the following code:

    $email = addSlashes(str_replace(array('\r', '\n', '\\', '/', '..'), '', $_GET['email'])); // protects against System File & Source Code Disclosure, Null Byte Injection and HTTP Header Injection

    The backslashes and dots seem to be the problem.

    What can I do to get this working?

    http://wordpress.org/extend/plugins/post-snippets/

  2. rfmcomposer
    Member
    Posted 2 years ago #

    I checked the plugin code and found the solution myself.

    The function function php_eval calls stripslashes().

    To get my code working I had to add a few extra backslashes:

    $email = addSlashes(str_replace(array('\\r', '\\n', '\\\\', '/', '..'), '', $_GET['email'])); // protects against System File & Source Code Disclosure, Null Byte Injection and HTTP Header Injection

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags