Opened 14 years ago
Closed 14 years ago
#21827 closed enhancement (fixed)
Use wp_parse_id_list() in gallery_shortcode()
| Reported by: | SergeyBiryukov | Owned by: | nacin |
|---|---|---|---|
| Priority: | low | Milestone: | 3.5 |
| Component: | Media | Version: | 3.0 |
| Severity: | normal | Keywords: | has-patch commit |
| Cc: | Focuses: |
Description
In gallery_shortcode(), a regex is used to sanitize a list of IDs in 'include' and 'exclude' parameters.
We have a special function for that:
http://core.trac.wordpress.org/browser/tags/3.4.2/wp-includes/functions.php#L2345
Attachments (2)
Change History (6)
#3
@
14 years ago
Indeed: http://core.trac.wordpress.org/browser/tags/3.4.2/wp-includes/post.php#L1450
Thanks! So the sanitization in gallery_shortcode() is not necessary at all.
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
wp_parse_id_list()is already applied to the'include'parameter inget_posts(), after the patch it would be done twice...Never mind, it's only done to be able to count the number of posts. It's not actually changing the'include'parameter.Wrong again... The
'include'parameter is being mapped to'post__in', withwp_parse_id_list()applied, and then not used again. Thus, with the patch from above,wp_parse_id_list()would be applied twice here.