• Resolved David Sword

    (@davidsword)


    Could there please be an option to disable the PHP executing? Even if it’s just wrapping the eval(‘s with a conditional constant that devs can define at theme level.

    (Love the plugin by the way, great work, and thank you for your hard word!).

    • This topic was modified 7 years, 8 months ago by David Sword.
    • This topic was modified 7 years, 8 months ago by David Sword.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Stefano Lissa

    (@satollo)

    Since I’m short of time, could you add and test that option? I think something like “apply_filters(‘hefo_php_exec’, true)” and if the result is false, the eval is suppressed.

    Stefano.

    @satollo

    Thanks for you quick reply and willingness to add this. The following worked for me:

    
    # plugin.php:hefo_wp_head_post()
    
    	if (apply_filters('hefo_php_exec', true)) {
    		ob_start();
    		eval('?>' . $buffer);
    		ob_end_flush();
    	} else {
    		echo $buffer;
    	}
    
    # plugin.php:hefo_wp_footer()
    
    	if (apply_filters('hefo_php_exec', true)) {
    	    ob_start();
    	    eval('?>' . $buffer);
    	    ob_end_flush();
    	} else {
    		echo $buffer;
    	}
    
    # plugin.php:hefo_execute()
    
        if (apply_filters('hefo_php_exec', true)) {
    	    ob_start();
        	eval('?>' . $buffer);
    	    $buffer = ob_get_clean();
        }
        return $buffer;
    
    # options.php:371
        <p>
    	    <?php
    		    if (apply_filters('hefo_php_exec', true)) {
    			    _e('PHP is allowed on textareas below.');
    			} else {
    				_e('PHP is not allowed on textareas below.');
    			}
            ?>
        </p>
    

    Then in my theme:

    
    add_filter( 'hefo_php_exec', create_function('',"return false;"));
    
    Plugin Author Stefano Lissa

    (@satollo)

    Perfect, Release the version 3.0.7. It’s a bit late hope that version has no errors :-).

    Stefano.

    Thread Starter David Sword

    (@davidsword)

    Beautiful! Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Option to turn off PHP exec’ is closed to new replies.