Project

General

Profile

Actions

Bug #8824

closed

is_numeric() on PHP 7 no longer validates hexadecimal values

Added by Jim Pingle over 6 years ago. Updated about 6 years ago.

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

100%

Estimated time:
Plus Target Version:
Release Notes:
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.

Actions #1

Updated by Jim Pingle over 6 years ago

  • Status changed from New to 13
Actions #2

Updated by Jim Pingle over 6 years ago

  • Status changed from 13 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.

Actions #3

Updated by Jim Pingle over 6 years ago

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

Updated by Anonymous about 6 years 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.

Actions

Also available in: Atom PDF