Skip to content

Commit

Permalink
wp_slash
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Aug 15, 2023
1 parent ea1603a commit dfd972e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/block-library/src/footnotes/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ function _wp_rest_api_autosave_meta( $autosave ) {
return;
}

update_post_meta( $id, 'footnotes', json_encode( $body['meta']['footnotes'] ) );
update_post_meta( $id, 'footnotes', wp_slash( $body['meta']['footnotes'] ) );
}
// See https://github.com/WordPress/wordpress-develop/blob/2103cb9966e57d452c94218bbc3171579b536a40/src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php#L391C1-L391C1.
add_action( 'wp_creating_autosave', '_wp_rest_api_autosave_meta' );
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/specs/editor/various/footnotes.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,12 +392,12 @@ test.describe( 'Footnotes', () => {
// path).
await editor.canvas.click( 'ol.wp-block-footnotes li span' );
await page.keyboard.press( 'End' );
await page.keyboard.type( '3' );
await page.keyboard.type( '3"' );

const previewPage2 = await editor.openPreviewPage();

await expect(
previewPage2.locator( 'ol.wp-block-footnotes li' )
).toHaveText( '123 ↩︎' );
).toHaveText( '123" ↩︎' );

Check failure on line 401 in test/e2e/specs/editor/various/footnotes.spec.js

View workflow job for this annotation

GitHub Actions / Playwright - 2

[chromium] › editor/various/footnotes.spec.js:364:2 › Footnotes › can be previewed when published

1) [chromium] › editor/various/footnotes.spec.js:364:2 › Footnotes › can be previewed when published Error: expect(received).toHaveText(expected) Expected string: "123\" ↩︎" Received string: "123″ ↩︎" Call log: - expect.toHaveText with timeout 5000ms - waiting for locator('ol.wp-block-footnotes li') - locator resolved to <li id="7d317669-7507-4e9d-8a13-f51d71521fe8">…</li> - unexpected value "123″ ↩︎" - waiting for locator('ol.wp-block-footnotes li') - locator resolved to <li id="7d317669-7507-4e9d-8a13-f51d71521fe8">…</li> - unexpected value "123″ ↩︎" - locator resolved to <li id="7d317669-7507-4e9d-8a13-f51d71521fe8">…</li> - unexpected value "123″ ↩︎" - locator resolved to <li id="7d317669-7507-4e9d-8a13-f51d71521fe8">…</li> - unexpected value "123″ ↩︎" - locator resolved to <li id="7d317669-7507-4e9d-8a13-f51d71521fe8">…</li> - unexpected value "123″ ↩︎" - locator resolved to <li id="7d317669-7507-4e9d-8a13-f51d71521fe8">…</li> - unexpected value "123″ ↩︎" - locator resolved to <li id="7d317669-7507-4e9d-8a13-f51d71521fe8">…</li> - unexpected value "123″ ↩︎" - locator resolved to <li id="7d317669-7507-4e9d-8a13-f51d71521fe8">…</li> - unexpected value "123″ ↩︎" 399 | await expect( 400 | previewPage2.locator( 'ol.wp-block-footnotes li' ) > 401 | ).toHaveText( '123" ↩︎' ); | ^ 402 | } ); 403 | } ); 404 | at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/footnotes.spec.js:401:5

Check failure on line 401 in test/e2e/specs/editor/various/footnotes.spec.js

View workflow job for this annotation

GitHub Actions / Playwright - 2

[chromium] › editor/various/footnotes.spec.js:364:2 › Footnotes › can be previewed when published

1) [chromium] › editor/various/footnotes.spec.js:364:2 › Footnotes › can be previewed when published Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toHaveText(expected) Expected string: "123\" ↩︎" Received string: "123″ ↩︎" Call log: - expect.toHaveText with timeout 5000ms - waiting for locator('ol.wp-block-footnotes li') - locator resolved to <li id="35201bd2-11d1-47f9-b97f-06241d913168">…</li> - unexpected value "123″ ↩︎" - waiting for locator('ol.wp-block-footnotes li') - locator resolved to <li id="35201bd2-11d1-47f9-b97f-06241d913168">…</li> - unexpected value "123″ ↩︎" - locator resolved to <li id="35201bd2-11d1-47f9-b97f-06241d913168">…</li> - unexpected value "123″ ↩︎" - locator resolved to <li id="35201bd2-11d1-47f9-b97f-06241d913168">…</li> - unexpected value "123″ ↩︎" - locator resolved to <li id="35201bd2-11d1-47f9-b97f-06241d913168">…</li> - unexpected value "123″ ↩︎" - locator resolved to <li id="35201bd2-11d1-47f9-b97f-06241d913168">…</li> - unexpected value "123″ ↩︎" - locator resolved to <li id="35201bd2-11d1-47f9-b97f-06241d913168">…</li> - unexpected value "123″ ↩︎" - locator resolved to <li id="35201bd2-11d1-47f9-b97f-06241d913168">…</li> - unexpected value "123″ ↩︎" 399 | await expect( 400 | previewPage2.locator( 'ol.wp-block-footnotes li' ) > 401 | ).toHaveText( '123" ↩︎' ); | ^ 402 | } ); 403 | } ); 404 | at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/footnotes.spec.js:401:5

Check failure on line 401 in test/e2e/specs/editor/various/footnotes.spec.js

View workflow job for this annotation

GitHub Actions / Playwright - 2

[chromium] › editor/various/footnotes.spec.js:364:2 › Footnotes › can be previewed when published

1) [chromium] › editor/various/footnotes.spec.js:364:2 › Footnotes › can be previewed when published Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toHaveText(expected) Expected string: "123\" ↩︎" Received string: "123″ ↩︎" Call log: - expect.toHaveText with timeout 5000ms - waiting for locator('ol.wp-block-footnotes li') - locator resolved to <li id="2b657927-46fc-4cba-97ba-f2b8db67d097">…</li> - unexpected value "123″ ↩︎" - waiting for locator('ol.wp-block-footnotes li') - locator resolved to <li id="2b657927-46fc-4cba-97ba-f2b8db67d097">…</li> - unexpected value "123″ ↩︎" - locator resolved to <li id="2b657927-46fc-4cba-97ba-f2b8db67d097">…</li> - unexpected value "123″ ↩︎" - locator resolved to <li id="2b657927-46fc-4cba-97ba-f2b8db67d097">…</li> - unexpected value "123″ ↩︎" - locator resolved to <li id="2b657927-46fc-4cba-97ba-f2b8db67d097">…</li> - unexpected value "123″ ↩︎" - locator resolved to <li id="2b657927-46fc-4cba-97ba-f2b8db67d097">…</li> - unexpected value "123″ ↩︎" - locator resolved to <li id="2b657927-46fc-4cba-97ba-f2b8db67d097">…</li> - unexpected value "123″ ↩︎" - locator resolved to <li id="2b657927-46fc-4cba-97ba-f2b8db67d097">…</li> - unexpected value "123″ ↩︎" 399 | await expect( 400 | previewPage2.locator( 'ol.wp-block-footnotes li' ) > 401 | ).toHaveText( '123" ↩︎' ); | ^ 402 | } ); 403 | } ); 404 | at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/footnotes.spec.js:401:5
} );
} );

0 comments on commit dfd972e

Please sign in to comment.