From 35b19ca6dc1245ee80324509fd01f551c03f94c3 Mon Sep 17 00:00:00 2001 From: jas- Date: Mon, 26 Aug 2013 15:53:30 -0600 Subject: [PATCH 1/2] Moved validation of Uri away from non- RFC3986 compliance to the 'Zend\Uri\UriFactory' method of validation --- src/Header/Origin.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Header/Origin.php b/src/Header/Origin.php index 78ee2059db..be6dfc2267 100644 --- a/src/Header/Origin.php +++ b/src/Header/Origin.php @@ -9,6 +9,8 @@ namespace Zend\Http\Header; +use \Zend\Uri\UriFactory; + /** * @throws Exception\InvalidArgumentException * @see http://tools.ietf.org/id/draft-abarth-origin-03.html#rfc.section.2 @@ -27,7 +29,8 @@ public static function fromString($headerLine) throw new Exception\InvalidArgumentException('Invalid header line for Origin string: "' . $name . '"'); } - if (!filter_var($value, FILTER_VALIDATE_URL)) { + $uri = UriFactory::factory($value); + if (!$uri->isValid()) { throw new Exception\InvalidArgumentException('Invalid header value for Origin key: "' . $name . '"'); } From ab3a4f5741688c0e321ffb8e43dd3e47f59c3b5a Mon Sep 17 00:00:00 2001 From: jas- Date: Wed, 28 Aug 2013 19:25:53 -0600 Subject: [PATCH 2/2] Removed @package descriptor as per @samsonasik's request --- test/Header/OriginTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/test/Header/OriginTest.php b/test/Header/OriginTest.php index 27b5ed84ef..a7f994f37d 100644 --- a/test/Header/OriginTest.php +++ b/test/Header/OriginTest.php @@ -5,7 +5,6 @@ * @link http://github.com/zendframework/zf2 for the canonical source repository * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @package Zend_Http */ namespace ZendTest\Http\Header;