php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #49180 Add FILTER_VALIDATE_MAC and FILTER_SANITIZE_MAC
Submitted: 2009-08-06 17:17 UTC Modified: 2013-02-03 12:29 UTC
Votes:3
Avg. Score:1.7 ± 0.9
Reproduced:0 of 2 (0.0%)
From: jmarois at ca dot ibm dot com Assigned: mj (profile)
Status: Closed Package: Filter related
PHP Version: 5.2.10 OS: Irrelevant
Private report: No CVE-ID: None
 [2009-08-06 17:17 UTC] jmarois at ca dot ibm dot com
Description:
------------
About your Data Filters
************************************************************************

First the validation filters.
------------------------------------------------------------------------

You defined: FILTER_VALIDATE_EMAIL, FILTER_VALIDATE_IP and FILTER_VALIDATE_URL.

I request adding: FILTER_VALIDATE_MAC for MAC addresses, considering  
(1) the six groups of two hexadecimal digits, separated by hyphens (-) or colons (:) format, and (2) three groups of four hexadecimal digits separated by dots (.) format. Of course, not forgetting the default of twelve hexadecimal digits.

Next the sanitizing filters.
------------------------------------------------------------------------

I request adding: FILTER_SANITIZE_MAC for MAC addresses, which would remove all characters except hexadecimal digits.


Reproduce code:
---------------
---
From manual page: filter.filters.validate
---



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-24 15:02 UTC] jani@php.net
-Summary: Feature Request +Summary: Add FILTER_VALIDATE_MAC and FILTER_SANITIZE_MAC -Package: Feature/Change Request +Package: Filter related
 [2012-12-26 10:45 UTC] mj@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: mj
 [2012-12-26 10:45 UTC] mj@php.net
https://github.com/php/php-src/pull/246 implements FILTER_VALIDATE_MAC.

I'm not sure if a sanitizing filter for MAC addresses makes sense though.
 [2012-12-26 10:46 UTC] mj@php.net
The correct PR is https://github.com/php/php-src/pull/247 actually.
 [2013-02-03 12:29 UTC] mj@php.net
-Status: Assigned +Status: Closed
 [2013-02-03 12:29 UTC] mj@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC