Procházet zdrojové kódy

[ZF-8244] add PHP_URL_SCHEME to parse_url() in validateUrn() of Zend_Soap_Client and Zend_Soap_Server

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@18888 44c647ce-9c0f-0410-b52a-842ac1e357ba
yoshida@zend.co.jp před 16 roky
rodič
revize
eda86f1ec9
2 změnil soubory, kde provedl 20 přidání a 13 odebrání
  1. 15 8
      library/Zend/Soap/Client.php
  2. 5 5
      library/Zend/Soap/Server.php

+ 15 - 8
library/Zend/Soap/Client.php

@@ -20,13 +20,19 @@
  * @version    $Id$
  */
 
-/** Zend_Soap_Server */
+/**
+ * @see Zend_Soap_Server
+ */
 require_once 'Zend/Soap/Server.php';
 
-/** Zend_Soap_Client_Local */
+/**
+ * @see Zend_Soap_Client_Local
+ */
 require_once 'Zend/Soap/Client/Local.php';
 
-/** Zend_Soap_Client_Common */
+/**
+ * @see Zend_Soap_Client_Common
+ */
 require_once 'Zend/Soap/Client/Common.php';
 
 /**
@@ -422,13 +428,14 @@ class Zend_Soap_Client
      */
     public function validateUrn($urn)
     {
-        $segs = parse_url($urn);
-        if (isset($segs['scheme'])) {
-            return true;
+        $scheme = parse_url($urn, PHP_URL_SCHEME);
+        if ($scheme === false || $scheme === null) {
+            require_once 'Zend/Soap/Client/Exception.php';
+            throw new Zend_Soap_Client_Exception('Invalid URN');
         }
 
-        require_once 'Zend/Soap/Client/Exception.php';
-        throw new Zend_Soap_Client_Exception('Invalid URN');
+        return true;
+
     }
 
     /**

+ 5 - 5
library/Zend/Soap/Server.php

@@ -327,13 +327,13 @@ class Zend_Soap_Server implements Zend_Server_Interface
      */
     public function validateUrn($urn)
     {
-        $segs = parse_url($urn);
-        if (isset($segs['scheme'])) {
-            return true;
+        $scheme = parse_url($urn, PHP_URL_SCHEME);
+        if ($scheme === false || $scheme === null) {
+            require_once 'Zend/Soap/Server/Exception.php';
+            throw new Zend_Soap_Server_Exception('Invalid URN');
         }
 
-        require_once 'Zend/Soap/Server/Exception.php';
-        throw new Zend_Soap_Server_Exception('Invalid URN');
+        return true;
     }
 
     /**