PluginProbe
Code Engine – PHP Snippets, AI Functions & Automation for WordPress / 0.4.1
Code Engine – PHP Snippets, AI Functions & Automation for WordPress v0.4.1
0.5.7 0.5.6 0.5.5 0.5.4 0.5.3 0.5.2 0.5.1 0.5.0 0.4.9 0.4.8 0.4.7 0.4.6 trunk 0.0.1 0.0.2 0.2.8 0.2.9 0.3.0 0.3.1 0.3.2 0.3.3 0.3.4 0.3.5 0.3.6 0.3.7 All 33 releases
← All changes | classes/core.php +2 -2 0.4.00.4.1 View file →
@@ -296,9 +296,9 @@
296 296 $snippet = $this->get_snippet( $id );
297 297 }
298 298
299 299 // Remove any PHP opening tag.
300 - $snippet['code'] = preg_replace( '/<\?php/', '', $snippet['code'], 1 );
300 + $snippet['code'] = $this->snippet->sanitize_code( $snippet['code'] );
301 301
302 302 if ( $test ) {
303 303 $snippet['code'] = preg_replace( '/echo\s+(.+?);/s', 'echo $1 . "\n";', $snippet['code'] );
304 304 }
@@ -626,9 +626,9 @@
626 626 return;
627 627 }
628 628
629 629 $snippets = array_map( function ( $snippet ) use ( $blocked ) {
630 - $snippet['code'] = preg_replace( '/<\?php/', '', $snippet['code'], 1 );
630 + $snippet['code'] = $this->snippet->sanitize_code( $snippet['code'] );
631 631 $snippet['blocked'] = $blocked;
632 632
633 633 // If the snippet must be executed only in the frontend, we bypass the block
634 634 if ( !is_admin() && $snippet['scope'] === 'frontend' ) {