Skip to content

Commit d91c275

Browse files
committed
Whitelist eval
1 parent 23006a0 commit d91c275

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/WP_CLI/REPL.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public function start() {
2828

2929
if ( self::starts_with( self::non_expressions(), $line ) ) {
3030
ob_start();
31+
// phpcs:ignore Squiz.PHP.Eval.Discouraged -- This is meant to be a REPL, no way to avoid eval.
3132
eval( $line );
3233
$out = ob_get_clean();
3334
if ( 0 < strlen( $out ) ) {
@@ -41,6 +42,7 @@ public function start() {
4142

4243
// Write directly to STDOUT, to sidestep any output buffers created by plugins
4344
ob_start();
45+
// phpcs:ignore Squiz.PHP.Eval.Discouraged -- This is meant to be a REPL, no way to avoid eval.
4446
$evl = eval( $line );
4547
$out = ob_get_clean();
4648
if ( 0 < strlen( $out ) ) {

0 commit comments

Comments
 (0)