Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#16975 closed defect (bug) (fixed)

JS autosave_update_slug() doesn't check if return is -1

Reported by: nacin's profile nacin Owned by:
Milestone: 3.2 Priority: lowest
Severity: trivial Version:
Component: General Keywords: has-patch
Focuses: Cc:

Description

If check_ajax_referer() fails, it'll die with -1. In autosave_update_slug(), we don't account for that, which results in a goofy -1 in the HTML.

See the example here: http://cl.ly/0Q341X010Z0c2H3s1R1I. Probably the most common reason for the check to fail would be if the user has since logged out, as you can see in the bottom right corner of the screenshot. I often see this when I discover tabs that I opened days before.

Attachments (1)

16975.diff (574 bytes) - added by nacin 15 years ago.

Download all attachments as: .zip

Change History (4)

@nacin
15 years ago

#1 @azaozz
15 years ago

Patch looks good, just one question: wouldn't it be better to leave the current slug unchanged (whatever it may be) instead of removing it?

#2 @nacin
15 years ago

Sure, that could work. It'd always come back when the user is logged in. I'm indifferent.

#3 @azaozz
15 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [17565]) Handle error response in autosave_update_slug(), props nacin, fixes #16975

Note: See TracTickets for help on using tickets.