Make WordPress Core

Opened 8 years ago

Closed 3 years ago

#15072 closed defect (bug) (wontfix)

blogger.getRecentPosts drops backslashes

Reported by: daveabrahams Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.1
Component: XML-RPC Keywords: needs-refresh
Focuses: Cc:


I have posts on my site containing fragments like:

[latex]\neg r(a,b)[/latex]

But when I pull them down using emacs weblogger-mode, the backslash is always missing. I edebug'ed way down into the bowels of the code and looked at the raw data arriving in the process buffer, and it was missing the backslash, so I'm pretty certain this is a WP bug and not something in emacs or weblogger-mode. Weblogger-mode is using the blogger API. I tried several other clients, and they seemed to work, but I assume they're using a different protocol (e.g. atom).

Attachments (1)

15072.diff (1.2 KB) - added by mdawaffe 7 years ago.

Download all attachments as: .zip

Change History (10)

#1 @josephscott
8 years ago

Most XML-RPC clients use the metaWeblog.getRecentPosts method. Does this have the same problem?

#2 @daveabrahams
8 years ago

  • Cc daveabrahams added

Ha! I didn't think I'd be able to figure out how to test that, but I did, and it works (or at least, doesn't have the backslash problem ;->).

#3 @daveabrahams
8 years ago

Of course, unless my client is misusing it, the metaWeblog API's "editPost" method doesn't respect the "publish" flag sent as its last parameter. So I have to use blogger's API for that. Kinda weird.

7 years ago

#4 @mdawaffe
7 years ago

  • Milestone changed from Awaiting Review to Future Release

Attached removes some useless stripslashes() calls in blogger.getPost and blogger.getRecentPosts.

That said, the 'spec' for those two methods is terrible. Title and categories have to be included in the struct's content parameter, each enclosed in an encoded XML tag. So the title and categories technically should be doubly encoded, but WP doesn't do that, and doing so would probably break any clients that use these methods.

Encourage your client's author to switch to metaWeblog.*

#5 @nacin
7 years ago

  • Keywords has-patch added

#6 @chriscct7
4 years ago

  • Keywords needs-refresh added; has-patch removed
  • Resolution set to invalid
  • Status changed from new to closed

The function in question now uses unslash instead of stripslashes due to #21767. As such the issue above no longer exists.

#7 @mdawaffe
4 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

wp_unslash() is just a wrapper for stripslashes(). The issue still exists (I just tested to confirm).

If we want to close this ticket as WONTFIX, that's fine with me.

#8 @chriscct7
4 years ago

Ah indeed, mind slipped there for a minute. Unless you think that refreshing the patch to remove the wp_unslash would be a better alternative, wontfix works

#9 @wonderboymusic
3 years ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.