Pārlūkot izejas kodu

Use <plugin>_info() function if at all possible instead of <plugin>_version()

pdontthink 18 gadi atpakaļ
vecāks
revīzija
efad17005b
1 mainītis faili ar 9 papildinājumiem un 1 dzēšanām
  1. 9 1
      plugins/bug_report/system_specs.php

+ 9 - 1
plugins/bug_report/system_specs.php

@@ -59,7 +59,15 @@ function br_show_plugins() {
             if ($key != 0 || $value != '') {
                 $str .= "    * $key = $value";
                 // add plugin version
-                if (function_exists($value . '_version')) {
+                $version_found = FALSE;
+                if (function_exists($value . '_info')) {
+                    $info = call_user_func($value . '_info');
+                    if (!empty($info['version'])) {
+                        $str .= ' ' . $info['version'];
+                        $version_found = TRUE;
+                    }
+                }
+                if (!$version_found && function_exists($value . '_version')) {
                     $str.= ' ' . call_user_func($value . '_version');
                 }
                 $str.="\n";