Project

General

Profile

Bug #8824

is_numeric() on PHP 7 no longer validates hexadecimal values

Added by Jim Pingle over 1 year ago. Updated over 1 year ago.

Status:
Resolved
Priority:
High
Assignee:
Category:
Web Interface
Target version:
Start date:
08/22/2018
Due date:
% Done:

100%

Estimated time:
Affected Version:
2.4.4
Affected Architecture:
All

Description

http://php.net/manual/en/function.is-numeric.php

7.0.0 Strings in hexadecimal (e.g. 0xf4c3b00c) notation are no longer regarded as numeric strings, i.e. is_numeric() returns FALSE now.

Best fix appears to be using http://php.net/manual/en/function.ctype-xdigit.php without prepending 0x to the string.

The only uses of this for hexadecimal that I can find is interfaces.php and handling of the track6 prefix ID, but worth checking for other instances.

History

#1 Updated by Jim Pingle over 1 year ago

  • Status changed from New to This Sprint

#2 Updated by Jim Pingle over 1 year ago

  • Status changed from This Sprint to Feedback

interfaces.php is fixed in b6f6210a220bb206fd22ac34b306f007afedb01f -- I can now set a prefix ID of 0, 1, D, etc and they all work as expected (save interface prefix ID, apply, edit/save/apply on tracked interface WAN, then the new subnet is there)

Checked through uses of is_numeric() in base and packages and didn't see any other instances of this.

#3 Updated by Jim Pingle over 1 year ago

  • Assignee set to Jim Pingle
  • % Done changed from 0 to 100

#4 Updated by Anonymous over 1 year ago

  • Status changed from Feedback to Resolved

Tested on: 2.4.4-DEVELOPMENT (amd64)
built on Tue Aug 28 08:43:43 EDT 2018
FreeBSD 11.2-RELEASE-p2

Haven't seen any errors in interfaces when using hex numbers.
Setting as resolved.

Also available in: Atom PDF