We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ae0f8d9 commit 013159aCopy full SHA for 013159a
php/admin-menus/class-edit-menu.php
@@ -169,6 +169,11 @@ private function validate_code( Snippet $snippet ) {
169
return false;
170
}
171
172
+ /* Skip snippets that contain named functions */
173
+ if ( preg_match( '/(?:function|class)\s+\w+/i', $snippet->code ) ) {
174
+ return false;
175
+ }
176
+
177
ob_start( array( $this, 'code_error_callback' ) );
178
$result = eval( $snippet->code );
179
ob_end_clean();
0 commit comments