Просмотр исходного кода

Zend_Amf: fix for ZF-10579.

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@23255 44c647ce-9c0f-0410-b52a-842ac1e357ba
alexander 15 лет назад
Родитель
Сommit
ca34bb7b50
1 измененных файлов с 6 добавлено и 3 удалено
  1. 6 3
      library/Zend/Amf/Server.php

+ 6 - 3
library/Zend/Amf/Server.php

@@ -300,12 +300,12 @@ class Zend_Amf_Server implements Zend_Server_Interface
                 $source = $mapped;
             }
         }
-        $qualifiedName = empty($source) ? $method : $source.".".$method;
+        $qualifiedName = empty($source) ? $method : $source . '.' . $method;
 
         if (!isset($this->_table[$qualifiedName])) {
             // if source is null a method that was not defined was called.
             if ($source) {
-                $className = str_replace(".", "_", $source);
+                $className = str_replace('.', '_', $source);
                 if(class_exists($className, false) && !isset($this->_classAllowed[$className])) {
                     require_once 'Zend/Amf/Server/Exception.php';
                     throw new Zend_Amf_Server_Exception('Can not call "' . $className . '" - use setClass()');
@@ -318,7 +318,10 @@ class Zend_Amf_Server implements Zend_Server_Interface
                 }
                 // Add the new loaded class to the server.
                 $this->setClass($className, $source);
-            } else {
+            }
+
+            if (!isset($this->_table[$qualifiedName])) {
+                // Source is null or doesn't contain specified method
                 require_once 'Zend/Amf/Server/Exception.php';
                 throw new Zend_Amf_Server_Exception('Method "' . $method . '" does not exist');
             }