OSDN Git Service

MERGE: リビジョン1781。Skinクラスのevalをcall_user_fun()に変更。
authorsakamocchi <o-takashi@sakamocchi.jp>
Sat, 21 Apr 2012 14:28:18 +0000 (23:28 +0900)
committersakamocchi <o-takashi@sakamocchi.jp>
Sat, 21 Apr 2012 14:28:18 +0000 (23:28 +0900)
れいんさんの提案を実装。
http://sourceforge.jp/projects/nucleus-jp/lists/archive/developers/2012-April/000897.html

Revision 1781:
CHANGE: use call_user_func() instead of eval() to call static method of
other class
changing processing in these two methods:
Skin::getAllowedActionsForType()
Skin::getFriendlyNames()
http://nucleuscms.svn.sourceforge.net/viewvc/nucleuscms?view=revision&revision=1781

nucleus/libs/SKIN.php

index 06320a8..4896fe5 100644 (file)
@@ -14,7 +14,7 @@
  *\r
  * @license http://nucleuscms.org/license.txt GNU General Public License\r
  * @copyright Copyright (C) 2002-2009 The Nucleus Group\r
- * @version $Id: SKIN.php 1780 2012-04-21 10:41:52Z sakamocchi $\r
+ * @version $Id: SKIN.php 1779 2012-04-21 10:04:33Z sakamocchi $\r
  */\r
 \r
 if ( !function_exists('requestVar') ) \r
@@ -577,12 +577,7 @@ class Skin
         */\r
        public function getAllowedActionsForType($type)\r
        {\r
-               /**\r
-                * NOTE: static method with variable class name is supported since PHP 5.3\r
-                *  So now we utilize eval function.\r
-                */\r
-               eval("\$defined_actions = {$this->action_class}::getDefinedActions('{$type}');");\r
-               return $defined_actions;\r
+               return call_user_func(array($this->action_class, 'getDefinedActions'), $type);\r
        }\r
        \r
        /**\r
@@ -595,11 +590,6 @@ class Skin
         */\r
        public function getFriendlyNames()\r
        {\r
-               /**\r
-                * NOTE: static method with variable class name is supported since PHP 5.3\r
-                *  So now we utilize eval function.\r
-                */\r
-               eval("\$friendly_names = {$this->action_class}::getSkinTypeFriendlyNames();");\r
-               return $friendly_names;\r
+               return call_user_func(array($this->action_class, 'getSkinTypeFriendlyNames'));\r
        }\r
 }\r