| @@ -54,9 +54,9 @@ | ||
| 54 | 54 | * @param callable $callback Handler callback |
| 55 | 55 | */ |
| 56 | 56 | public function register_handler($method, $callback) { |
| 57 | 57 | if (!is_callable($callback)) { |
| 58 | - throw new InvalidArgumentException("Handler for method '{$method}' must be callable"); | |
| 58 | + throw new InvalidArgumentException("Handler for method '{$method}' must be callable"); // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped -- JSON-RPC error payload, JSON-encoded on output, never rendered as HTML; escaping here would corrupt message bytes | |
| 59 | 59 | } |
| 60 | 60 | $this->handlers[$method] = $callback; |
| 61 | 61 | } |
| 62 | 62 | |
| @@ -111,9 +111,9 @@ | ||
| 111 | 111 | |
| 112 | 112 | return $this->error_response($id, self::ERROR_INVALID_PARAMS, $e->getMessage()); |
| 113 | 113 | } catch (Exception $e) { |
| 114 | 114 | // Log error |
| 115 | - error_log('MCP JSON-RPC Error: ' . $e->getMessage()); | |
| 115 | + error_log('MCP JSON-RPC Error: ' . $e->getMessage()); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- genuine failure path, bounded, no secrets | |
| 116 | 116 | if (!array_key_exists('id', $request)) { |
| 117 | 117 | return null; |
| 118 | 118 | } |
| 119 | 119 | |