Opened 8 months ago

Last modified 8 months ago

#131 new enhancement

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

Reported by: alexkingorg Owned by:
Priority: normal Milestone:
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 8 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 8 months ago.

Download all attachments as: .zip

Change History (5)

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

You now have commit to this repo.

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 8 months ago by alexkingorg (previous) (diff)

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.