Skip to content

Commit 8da2869

Browse files
committed
Prevent invalid property keys
1 parent f1cb36f commit 8da2869

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/MCP/Servers/WP_CLI/Tools/CliCommands.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function get_tools(): array {
7777

7878
foreach ( $synopsis_spec as $arg ) {
7979
if ( 'positional' === $arg['type'] || 'assoc' === $arg['type'] ) {
80-
$prop_name = str_replace( '-', '_', $arg['name'] );
80+
$prop_name = str_replace( [ '-', '|' ], '_', $arg['name'] );
8181
$properties[ $prop_name ] = [
8282
'type' => 'string',
8383
'description' => "Parameter {$arg['name']}",

0 commit comments

Comments
 (0)