Преглед изворни кода

simplified check. thanks, Jon.

tokul пре 20 година
родитељ
комит
2845b7c446
1 измењених фајлова са 5 додато и 4 уклоњено
  1. 5 4
      functions/plugin.php

+ 5 - 4
functions/plugin.php

@@ -199,11 +199,12 @@ function is_plugin_enabled($plugin_name) {
   global $plugins;
 
   /**
-   * check if variable is set. can't do is_array(), if variable is not set
-   * check if it is an array
-   * there is no need to call in_array() if $plugins array is empty
+   * check if variable is empty. if var is not set, php empty 
+   * returns true without error notice.
+   *
+   * then check if it is an array
    */
-  if (! isset($plugins) || ! is_array($plugins) || empty($plugins))
+  if (empty($plugins) || ! is_array($plugins))
     return false;
 
   if ( in_array($plugin_name,$plugins) ) {