Repository navigation
Commit 7cc6bb5
Keep backslashes in ideation drafts and update-post-fields (#208)
* fix(ideation): keep backslashes in drafts created from a project
wp_insert_post() unslashes its input, so the drafted title and block
content lost every backslash: a code sample's C:\Users\tom was saved as
C:Userstom. Slash the post array first, as StageAgent::write_content()
does.
Adds a success-path test for the create-draft route that configures a
provider and cans its HTTP replies with pre_http_request, so the real
route runs end to end.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(abilities): keep backslashes in update-post-fields titles and excerpts
wp_update_post() unslashes its input, so a backslash in a title or
excerpt set through the ability was lost. Slash the update array before
the call. The preview and the returned values stay unslashed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test: cover backslashes through the REST routes, kses and other fields
Run both #197 paths through rest_do_request(): the ideation create-draft
route, and the update-post-fields ability's run route with REST
visibility switched on for the test only. Decoded JSON input arrives
unslashed, so the stored title, excerpt and block attributes keep single
backslashes. Also cover an author without unfiltered_html, raw block
attribute JSON, and author and date updates alongside a backslashed
title. Give the preview fixture an empty excerpt, which the factory
otherwise fills.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>1 parent abb9946 commit 7cc6bb5
4 files changed
Lines changed: 591 additions & 10 deletions
File tree
- vip-workflows
- includes
- abilities/tools
- api
- tests/phpunit/Integration
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
127 | 130 | | |
128 | 131 | | |
129 | 132 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
895 | 895 | | |
896 | 896 | | |
897 | 897 | | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
898 | 901 | | |
899 | | - | |
900 | | - | |
901 | | - | |
902 | | - | |
903 | | - | |
904 | | - | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
905 | 910 | | |
906 | 911 | | |
907 | 912 | | |
| |||
0 commit comments