WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 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:

Description

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 5 years ago.

Download all attachments as: .zip

Change History (4)

projct5 years ago

comment:1 follow-up: DD325 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.

comment:2 in reply to: ↑ 1 azaozz5 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.

comment:3 azaozz5 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.