From 22702160e6c74460c4937952b9a016d40503c671 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 22 Nov 2010 12:46:38 -0500 Subject: fix: pluginlist.php's metaInfo(): Warning: horribly inefficient and may explode! This also means that plugins who give themselves a funny name now have their data show up in the plugins page (where, before they'de be there, but the info on them would be blank). Unfortunately, this removes a hack for URL shorteners. However, this is minor, and I think my plugin system may have broken it anyway. (maybe) --- lib/pluginlist.php | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/lib/pluginlist.php b/lib/pluginlist.php index 0e1a81249..1e15aea64 100644 --- a/lib/pluginlist.php +++ b/lib/pluginlist.php @@ -166,37 +166,11 @@ class PluginListItem extends Widget /** * Grab metadata about this plugin... - * Warning: horribly inefficient and may explode! - * Doesn't work for disabled plugins either. - * - * @fixme pull structured data from plugin source */ function metaInfo() { $versions = self::getPluginVersions(); - $found = false; - - foreach ($versions as $info) { - // hack for URL shorteners... "LilUrl (ur1.ca)" etc - list($name, ) = explode(' ', $info['name']); - - if ($name == $this->plugin) { - if ($found) { - // hack for URL shorteners... - $found['rawdescription'] .= "
\n" . $info['rawdescription']; - } else { - $found = $info; - } - } - } - - if ($found) { - return $found; - } else { - return array('name' => $this->plugin, - 'rawdescription' => _m('plugin-description', - '(Plugin descriptions unavailable when disabled.)')); - } + return $versions[$this->plugin]; } /** -- cgit v1.2.3