#56657 closed defect (bug) (invalid)
Invalid URL in class-wp-embed.php file
Reported by: | vinoth06 | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | blocker | Version: | 2.9 |
Component: | Embeds | Keywords: | has-patch |
Focuses: | Cc: |
Description
Hi,
In line https://github.com/WordPress/wordpress-develop/blob/599622ccc76d31a63c685b5657307d662d4bcae5/src/wp-includes/class-wp-embed.php#L93 there is an invalid URL structure and causing a 404 error on AJAX call.
Current Version
$.get("<?php echo esc_url( admin_url( 'admin-ajax.php', 'relative' ) ) . '?action=oembed-cache&post=' . $post->ID; ?>");
Hope it should be like
<?php $.get("<?php echo esc_url( admin_url( 'admin-ajax.php', 'relative' ) ) . '&action=oembed-cache&post=' . $post->ID; ?>");
The ? should be replaced with &.
Please let me know if the above is not clear.
Thanks
Change History (6)
Note: See
TracTickets for help on using
tickets.
Hi there, welcome back to WordPress Trac! Thanks for the report.
The URL was introduced in [12023] for WordPress 2.9, setting the version accordingly. It was further adjusted in [19871] to use a relative path and in [51177] to use escaping.
The current URL looks correct to me:
The proposed change, on the other hand, does not look correct:
If the current URL causes a 404 error on your install, I think there might be something else at play here. Does the issue still happen with all plugins disabled and a default theme (Twenty Twenty-Two) activated? Could you share the steps to reproduce it on a clean install?