| @@ -263,9 +263,9 @@ | ||
| 263 | 263 | // Update post |
| 264 | 264 | $updated_id = wp_update_post($update_args, true); |
| 265 | 265 | |
| 266 | 266 | if (is_wp_error($updated_id)) { |
| 267 | - throw new Exception("Failed to update post: " . $updated_id->get_error_message()); | |
| 267 | + throw new Exception("Failed to update post: " . $updated_id->get_error_message()); // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped -- JSON-RPC error payload, JSON-encoded on output, never rendered as HTML; escaping here would corrupt message bytes | |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | // Get updated post |
| 271 | 271 | $updated_post = get_post($post_id); |
| @@ -458,9 +458,9 @@ | ||
| 458 | 458 | * @return int|false |
| 459 | 459 | */ |
| 460 | 460 | private function resolve_by_slug( $raw, $post_type ) { |
| 461 | 461 | // Extract last path segment (handles /blog/my-post/ → my-post) |
| 462 | - $path = parse_url( $raw, PHP_URL_PATH ); | |
| 462 | + $path = wp_parse_url( $raw, PHP_URL_PATH ); | |
| 463 | 463 | $segments = array_filter( explode( '/', $path ?? $raw ) ); |
| 464 | 464 | $slug = sanitize_title( end( $segments ) ); |
| 465 | 465 | |
| 466 | 466 | if ( empty( $slug ) ) { |