WordPress.org

Make WordPress Core

Opened 19 months ago

Last modified 19 months ago

#131 new enhancement

Unit Tests for Core #21767 (Remove stripslashes from API functions)

Reported by: alexkingorg Owned by:
Milestone: Priority: normal
Component: Escaping Keywords:
Cc: nacin

Description

Wanted to start contributing the tests needed for this core ticket:

http://core.trac.wordpress.org/ticket/21767

Coverage is not yet sufficient, but this initial patch does cover posts, post meta and comments.

There is also a change to remove the manual adding of slashes in the methods to create comments. This was the only object that was getting "properly" slashed before the WP model API functions were called (in other words, all other objects were doing it wrong) and the core patch obviates the need for this.

Attachments (2)

slashes-tests-20120920.diff (15.8 KB) - added by alexkingorg 19 months ago.
Initial test coverage (posts, post meta, comments) and slash fix in comment test methods.
remove-addslashes-deep.diff (657 bytes) - added by alexkingorg 19 months ago.

Download all attachments as: .zip

Change History (5)

alexkingorg19 months ago

Initial test coverage (posts, post meta, comments) and slash fix in comment test methods.

comment:1 nacin19 months ago

You now have commit to this repo.

comment:2 alexkingorg19 months ago

Commit access huh?

https://gimmebar-assets.s3.amazonaws.com/505e39091176e.gif

I did an initial commit that covers:

  • posts
  • post meta
  • comments
  • comment meta

http://unit-tests.trac.wordpress.org/changeset/1041

I also noticed some slash tests in tests/meta.php that will need to be revised. I'm holding off on those types of changes until we're ready for the patch to land.

Last edited 19 months ago by alexkingorg (previous) (diff)

comment:3 alexkingorg19 months ago

Ok, I've committed what I believe to be reasonable coverage for core ticket 21767 in revision 1071.

I'm also attaching a patch for removing the additional slashes in the factory class - this will need to be committed when 21767 lands.

Note: See TracTickets for help on using tickets.