Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#8659 closed defect (bug) (fixed)

wp-includes/js/autosave.js: Force parseInt() on user supplied data to use base 10

Reported by: projct Owned by:
Milestone: 2.8 Priority: normal
Severity: normal Version: 2.7
Component: General Keywords: has-patch
Focuses: Cc:


parseInt will try to autodetect the original base if you don't specify it, this could lead to undesired behavior.

Attachments (1)

parseInt-base-10.diff (1.7 KB) - added by projct 9 years ago.

Download all attachments as: .zip

Change History (4)

#1 follow-up: @DD32
9 years ago

This is pretty redundant IMO, the post_id's will allways be generated by WP, its not user-supplied data, so it should always be a number not prefixed with 0.

#2 in reply to: ↑ 1 @azaozz
9 years ago

  • Milestone changed from 2.7.1 to 2.8

Replying to DD32: Agreed, but this is more of a coding standards related change in this case. It's better to get the guessing out of parseInt() unless it's specifically needed.

#3 @azaozz
9 years ago

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

(In [10235]) Set parseInt() to use base 10 instead of detecting it, props projct, fixes #8659

Note: See TracTickets for help on using tickets.