Revision: 10263
http://sourceforge.net/p/phpwiki/code/10263
Author: vargenau
Date: 2021-02-22 20:38:42 +0000 (Mon, 22 Feb 2021)
Log Message:
-----------
plugin PopularNearby: better test boolean argument "noheader"
Modified Paths:
--------------
trunk/lib/plugin/PopularNearby.php
Modified: trunk/lib/plugin/PopularNearby.php
===================================================================
--- trunk/lib/plugin/PopularNearby.php 2021-02-22 20:31:04 UTC (rev 10262)
+++ trunk/lib/plugin/PopularNearby.php 2021-02-22 20:38:42 UTC (rev 10263)
@@ -52,7 +52,7 @@
'mode' => 'nearby', // or 'incoming' or 'outgoing'
//'exclude' => false, // not yet
'limit' => 5,
- 'noheader' => 0,
+ 'noheader' => false,
);
}
@@ -73,6 +73,15 @@
}
extract($args);
+
+ if (($noheader == '0') || ($noheader == 'false')) {
+ $noheader = false;
+ } elseif (($noheader == '1') || ($noheader == 'true')) {
+ $noheader = true;
+ } else {
+ return $this->error(sprintf(_("Argument '%s' must be a boolean"), "noheader"));
+ }
+
$header = '';
$page = $dbi->getPage($pagename);
switch ($mode) {
@@ -153,7 +162,7 @@
function sortByHits($links)
{
if (!$links) return array();
- usort($links, 'cmp_by_hits'); // php-4.0.6 cannot use methods
+ usort($links, 'cmp_by_hits');
reset($links);
return $links;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|