|
From: <var...@us...> - 2021-09-10 13:14:14
|
Revision: 10550
http://sourceforge.net/p/phpwiki/code/10550
Author: vargenau
Date: 2021-09-10 13:14:12 +0000 (Fri, 10 Sep 2021)
Log Message:
-----------
NewPagesPerUser plugin: check comments and links are boolean
Modified Paths:
--------------
trunk/lib/plugin/NewPagesPerUser.php
Modified: trunk/lib/plugin/NewPagesPerUser.php
===================================================================
--- trunk/lib/plugin/NewPagesPerUser.php 2021-09-10 13:12:44 UTC (rev 10549)
+++ trunk/lib/plugin/NewPagesPerUser.php 2021-09-10 13:14:12 UTC (rev 10550)
@@ -47,12 +47,11 @@
function getDefaultArguments()
{
return array('userid' => '',
- 'month' => 0,
- 'since' => 0,
- 'until' => 0,
- 'comments' => 0,
- 'links' => 1,
- 'debug' => 0,
+ 'month' => '',
+ 'since' => '',
+ 'until' => '',
+ 'comments' => false,
+ 'links' => true
);
}
@@ -68,6 +67,22 @@
global $WikiTheme;
$args = $this->getArgs($argstr, $request);
extract($args);
+
+ if (($comments == '0') || ($comments == 'false')) {
+ $comments = false;
+ } elseif (($comments == '1') || ($comments == 'true')) {
+ $comments = true;
+ } else {
+ return $this->error(sprintf(_("Argument '%s' must be a boolean"), "comments"));
+ }
+ if (($links == '0') || ($links == 'false')) {
+ $links = false;
+ } elseif (($links == '1') || ($links == 'true')) {
+ $links = true;
+ } else {
+ return $this->error(sprintf(_("Argument '%s' must be a boolean"), "links"));
+ }
+
if ($since)
$since = strtotime($since);
if ($month) {
@@ -85,11 +100,7 @@
if (!$page->exists()) continue;
$rev = $page->getRevision(1, false);
$date = $rev->get('mtime');
- //$author = $rev->get('author_id');
$author = $page->getOwner();
- if (defined('DEBUG') && DEBUG && $debug) {
- echo "<i>$pagename, ", strftime("%Y-%m-%d %h:%m:%s", $date), ", $author</i><br />\n";
- }
if ($userid and (!preg_match("/" . $userid . "/", $author))) continue;
if ($since and $date < $since) continue;
if ($until and $date > $until) continue;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|