You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(43) |
Nov
(73) |
Dec
(10) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(34) |
Feb
(110) |
Mar
(24) |
Apr
(44) |
May
(37) |
Jun
(22) |
Jul
(20) |
Aug
(28) |
Sep
(50) |
Oct
(11) |
Nov
(132) |
Dec
(595) |
2002 |
Jan
(1099) |
Feb
(579) |
Mar
(63) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(125) |
Sep
(101) |
Oct
(25) |
Nov
(34) |
Dec
(47) |
2003 |
Jan
(82) |
Feb
(182) |
Mar
(71) |
Apr
(3) |
May
(1) |
Jun
(3) |
Jul
|
Aug
|
Sep
(14) |
Oct
(6) |
Nov
(124) |
Dec
(68) |
2004 |
Jan
(64) |
Feb
(191) |
Mar
(199) |
Apr
(298) |
May
(252) |
Jun
(426) |
Jul
(134) |
Aug
(13) |
Sep
(96) |
Oct
(75) |
Nov
(232) |
Dec
(171) |
2005 |
Jan
(205) |
Feb
(165) |
Mar
(8) |
Apr
(74) |
May
(21) |
Jun
(19) |
Jul
(37) |
Aug
(69) |
Sep
(141) |
Oct
(118) |
Nov
(31) |
Dec
(7) |
2006 |
Jan
(5) |
Feb
(10) |
Mar
(35) |
Apr
(24) |
May
(34) |
Jun
(29) |
Jul
(5) |
Aug
(38) |
Sep
(30) |
Oct
(37) |
Nov
(30) |
Dec
(86) |
2007 |
Jan
(414) |
Feb
(40) |
Mar
(18) |
Apr
(10) |
May
(66) |
Jun
(60) |
Jul
(105) |
Aug
(55) |
Sep
(64) |
Oct
(7) |
Nov
(11) |
Dec
(5) |
2008 |
Jan
(26) |
Feb
(28) |
Mar
(79) |
Apr
(34) |
May
(61) |
Jun
(24) |
Jul
(29) |
Aug
(160) |
Sep
(62) |
Oct
(70) |
Nov
(32) |
Dec
(14) |
2009 |
Jan
(140) |
Feb
(135) |
Mar
(153) |
Apr
(53) |
May
(24) |
Jun
(138) |
Jul
(90) |
Aug
(46) |
Sep
(72) |
Oct
(84) |
Nov
(32) |
Dec
(4) |
2010 |
Jan
(13) |
Feb
(7) |
Mar
(14) |
Apr
(55) |
May
(89) |
Jun
(131) |
Jul
(41) |
Aug
(38) |
Sep
(42) |
Oct
(11) |
Nov
(27) |
Dec
(54) |
2011 |
Jan
(127) |
Feb
(16) |
Mar
(71) |
Apr
(52) |
May
(32) |
Jun
(31) |
Jul
(4) |
Aug
|
Sep
(45) |
Oct
(26) |
Nov
(36) |
Dec
(10) |
2012 |
Jan
(23) |
Feb
(6) |
Mar
(13) |
Apr
(18) |
May
(1) |
Jun
(4) |
Jul
(3) |
Aug
(12) |
Sep
(57) |
Oct
(96) |
Nov
(163) |
Dec
(124) |
2013 |
Jan
(11) |
Feb
(17) |
Mar
(7) |
Apr
(48) |
May
(15) |
Jun
(29) |
Jul
(12) |
Aug
|
Sep
(9) |
Oct
|
Nov
|
Dec
(3) |
2014 |
Jan
(4) |
Feb
(1) |
Mar
(2) |
Apr
(1) |
May
(8) |
Jun
(90) |
Jul
(104) |
Aug
(12) |
Sep
(81) |
Oct
(139) |
Nov
(111) |
Dec
(64) |
2015 |
Jan
(46) |
Feb
(74) |
Mar
(56) |
Apr
(61) |
May
(3) |
Jun
(7) |
Jul
(11) |
Aug
(5) |
Sep
(15) |
Oct
(1) |
Nov
(1) |
Dec
(15) |
2016 |
Jan
(25) |
Feb
(33) |
Mar
(24) |
Apr
(4) |
May
(24) |
Jun
(3) |
Jul
(75) |
Aug
|
Sep
(2) |
Oct
(38) |
Nov
(4) |
Dec
(18) |
2017 |
Jan
(8) |
Feb
(1) |
Mar
(1) |
Apr
|
May
(14) |
Jun
|
Jul
(5) |
Aug
(9) |
Sep
|
Oct
(23) |
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
(9) |
Apr
(60) |
May
(1) |
Jun
|
Jul
(13) |
Aug
|
Sep
(11) |
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
(15) |
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(47) |
2021 |
Jan
(24) |
Feb
(33) |
Mar
(1) |
Apr
|
May
(1) |
Jun
(64) |
Jul
(71) |
Aug
(114) |
Sep
(82) |
Oct
(32) |
Nov
(76) |
Dec
(86) |
2022 |
Jan
(162) |
Feb
(41) |
Mar
(11) |
Apr
(9) |
May
|
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(7) |
2023 |
Jan
|
Feb
(1) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
(25) |
Aug
|
Sep
|
Oct
|
Nov
(7) |
Dec
|
2024 |
Jan
(7) |
Feb
(3) |
Mar
(3) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
|
Feb
(90) |
Mar
(19) |
Apr
|
May
(6) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <var...@us...> - 2021-09-20 09:09:58
|
Revision: 10574 http://sourceforge.net/p/phpwiki/code/10574 Author: vargenau Date: 2021-09-20 09:09:55 +0000 (Mon, 20 Sep 2021) Log Message: ----------- Remove useless semicolon Modified Paths: -------------- trunk/lib/WikiTheme.php trunk/lib/plugin/TexToPng.php trunk/lib/plugin/WhoIsOnline.php trunk/lib/wikilens/Buddy.php Modified: trunk/lib/WikiTheme.php =================================================================== --- trunk/lib/WikiTheme.php 2021-09-20 08:23:20 UTC (rev 10573) +++ trunk/lib/WikiTheme.php 2021-09-20 09:09:55 UTC (rev 10574) @@ -1689,7 +1689,7 @@ */ function CbUserLogin(&$request, $userid) { - ; // do nothing + // do nothing } /* @@ -1698,7 +1698,7 @@ */ function CbNewUserEdit(&$request, $userid) { - ; // i.e. create homepage with Template/UserPage + // i.e. create homepage with Template/UserPage } /* @@ -1710,7 +1710,7 @@ */ function CbNewUserLogin(&$request, $userid) { - ; // do nothing + // do nothing } /* @@ -1719,7 +1719,7 @@ */ function CbUserLogout(&$request, $userid) { - ; // do nothing + // do nothing } } Modified: trunk/lib/plugin/TexToPng.php =================================================================== --- trunk/lib/plugin/TexToPng.php 2021-09-20 08:23:20 UTC (rev 10573) +++ trunk/lib/plugin/TexToPng.php 2021-09-20 09:09:55 UTC (rev 10574) @@ -222,7 +222,6 @@ if (!$complainvisibly) { $this->dbg('Error during execution of ' . $cmd); } - ; foreach ($errortxt as $key => $value) { if ($complainvisibly) { $this->complain($value . "\n"); Modified: trunk/lib/plugin/WhoIsOnline.php =================================================================== --- trunk/lib/plugin/WhoIsOnline.php 2021-09-20 08:23:20 UTC (rev 10573) +++ trunk/lib/plugin/WhoIsOnline.php 2021-09-20 09:09:55 UTC (rev 10574) @@ -98,7 +98,6 @@ function getSessions($dbi, &$request) { // check the current user sessions and what they are doing - ; } // check the current sessions Modified: trunk/lib/wikilens/Buddy.php =================================================================== --- trunk/lib/wikilens/Buddy.php 2021-09-20 08:23:20 UTC (rev 10573) +++ trunk/lib/wikilens/Buddy.php 2021-09-20 09:09:55 UTC (rev 10574) @@ -77,7 +77,6 @@ $result = $dbh->_dbh->query($query); } else { // from 10 random raters of this page (non-SQL) - ; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-09-20 08:23:23
|
Revision: 10573 http://sourceforge.net/p/phpwiki/code/10573 Author: vargenau Date: 2021-09-20 08:23:20 +0000 (Mon, 20 Sep 2021) Log Message: ----------- Remove useless local variable Modified Paths: -------------- trunk/lib/BlockParser.php trunk/lib/HttpClient.php trunk/lib/PageList.php trunk/lib/editpage.php trunk/lib/loadsave.php trunk/lib/plugin/BackLinks.php trunk/lib/plugin/Diff.php trunk/lib/plugin/IncludePage.php trunk/lib/plugin/LinkSearch.php trunk/lib/plugin/ListPages.php trunk/lib/plugin/ListSubpages.php trunk/lib/plugin/RawHtml.php trunk/lib/plugin/SemanticSearchAdvanced.php trunk/lib/plugin/SystemInfo.php trunk/lib/plugin/UriResolver.php trunk/lib/plugin/VisualWiki.php trunk/lib/plugin/WikiAdminSetAclSimple.php trunk/lib/stdlib.php Modified: trunk/lib/BlockParser.php =================================================================== --- trunk/lib/BlockParser.php 2021-09-20 07:56:53 UTC (rev 10572) +++ trunk/lib/BlockParser.php 2021-09-20 08:23:20 UTC (rev 10573) @@ -1423,9 +1423,7 @@ } // Expand leading tabs. $text = expand_tabs($text); - $output = new WikiText($text); - - return $output; + return new WikiText($text); } /** Modified: trunk/lib/HttpClient.php =================================================================== --- trunk/lib/HttpClient.php 2021-09-20 07:56:53 UTC (rev 10572) +++ trunk/lib/HttpClient.php 2021-09-20 08:23:20 UTC (rev 10573) @@ -295,8 +295,7 @@ $headers[] = 'Content-Type: ' . $ContentType; $headers[] = 'Content-Length: ' . strlen($this->postdata); } - $request = implode("\r\n", $headers) . "\r\n\r\n" . $this->postdata; - return $request; + return implode("\r\n", $headers) . "\r\n\r\n" . $this->postdata; } function getStatus() Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2021-09-20 07:56:53 UTC (rev 10572) +++ trunk/lib/PageList.php 2021-09-20 08:23:20 UTC (rev 10573) @@ -1091,8 +1091,7 @@ return $order . $column; } elseif ($action == 'check') { // show icon? //if specified via arg or if clicked - $show = (!empty($this->_sortby[$column]) or $this->sortby($column, 'clicked')); - return $show; + return (!empty($this->_sortby[$column]) or $this->sortby($column, 'clicked')); } elseif ($action == 'clicked') { // flip sort order? global $request; $arg = $request->getArg('sortby'); Modified: trunk/lib/editpage.php =================================================================== --- trunk/lib/editpage.php 2021-09-20 07:56:53 UTC (rev 10572) +++ trunk/lib/editpage.php 2021-09-20 08:23:20 UTC (rev 10573) @@ -841,7 +841,7 @@ } if (!$categories) return ''; // Ensure this to be inserted at the very end. Hence we added the id to the function. - $more_buttons = HTML::img(array('class' => "toolbar", + return HTML::img(array('class' => "toolbar", 'id' => 'tb-categories', 'src' => $WikiTheme->getImageURL("ed_category.png"), 'title' => _("Insert Categories"), @@ -851,7 +851,6 @@ . "',[" . join(",", $categories) . "],'" . _("Insert") . "','" . _("Close") . "','tb-categories')")); - return $more_buttons; } return ''; } @@ -891,7 +890,7 @@ } } $plugin_js = substr($plugin_js, 1); - $more_buttons = HTML::img(array('class' => "toolbar", + return HTML::img(array('class' => "toolbar", 'id' => 'tb-plugins', 'src' => $WikiTheme->getImageURL("ed_plugins.png"), 'title' => _("Insert Plugin"), @@ -901,7 +900,6 @@ . "',[" . $plugin_js . "],'" . _("Insert") . "','" . _("Close") . "','tb-plugins')")); - return $more_buttons; } return ''; } @@ -1270,10 +1268,9 @@ protected function getConflictMessage($unresolved = false) { - $message = HTML(HTML::p(fmt("Some of the changes could not automatically be combined. Please look for sections beginning with “%s”, and ending with “%s”. You will need to edit those sections by hand before you click Save.", + return HTML(HTML::p(fmt("Some of the changes could not automatically be combined. Please look for sections beginning with “%s”, and ending with “%s”. You will need to edit those sections by hand before you click Save.", "<<<<<<<", "======="), HTML::p(_("Please check it through before saving.")))); - return $message; } } Modified: trunk/lib/loadsave.php =================================================================== --- trunk/lib/loadsave.php 2021-09-20 07:56:53 UTC (rev 10572) +++ trunk/lib/loadsave.php 2021-09-20 08:23:20 UTC (rev 10573) @@ -1165,8 +1165,7 @@ $fd = fopen($mapfile, "rb"); $data = fread($fd, filesize($mapfile)); fclose($fd); - $content = $content . "\n<verbatim>\n$data</verbatim>\n"; - return $content; + return $content . "\n<verbatim>\n$data</verbatim>\n"; } function ParseSerializedPage($text, $default_pagename, $user) Modified: trunk/lib/plugin/BackLinks.php =================================================================== --- trunk/lib/plugin/BackLinks.php 2021-09-20 07:56:53 UTC (rev 10572) +++ trunk/lib/plugin/BackLinks.php 2021-09-20 08:23:20 UTC (rev 10573) @@ -218,7 +218,6 @@ function _getValue($page_handle, $revision_handle) { $iter = $page_handle->getPageLinks(); - $count = $iter->count(); - return $count; + return $iter->count(); } } Modified: trunk/lib/plugin/Diff.php =================================================================== --- trunk/lib/plugin/Diff.php 2021-09-20 07:56:53 UTC (rev 10572) +++ trunk/lib/plugin/Diff.php 2021-09-20 08:23:20 UTC (rev 10573) @@ -102,9 +102,8 @@ $page = $request->getPage($pagename); $current = $page->getCurrentRevision(); if ($current->getVersion() < 1) { - $html = HTML(HTML::p(fmt("Page “%s” does not exist.", - WikiLink($pagename, 'unknown')))); - return $html; //early return + return HTML(HTML::p(fmt("Page “%s” does not exist.", + WikiLink($pagename, 'unknown')))); //early return } if ($version) { Modified: trunk/lib/plugin/IncludePage.php =================================================================== --- trunk/lib/plugin/IncludePage.php 2021-09-20 07:56:53 UTC (rev 10572) +++ trunk/lib/plugin/IncludePage.php 2021-09-20 08:23:20 UTC (rev 10573) @@ -231,7 +231,6 @@ $c = array($ct, sprintf(_(" ... first %d bytes"), $bytes)); } } - $ct = implode("\n", $c); // one string - return $ct; + return implode("\n", $c); // one string } } Modified: trunk/lib/plugin/LinkSearch.php =================================================================== --- trunk/lib/plugin/LinkSearch.php 2021-09-20 07:56:53 UTC (rev 10572) +++ trunk/lib/plugin/LinkSearch.php 2021-09-20 08:23:20 UTC (rev 10573) @@ -112,7 +112,7 @@ */ $submit = Button('submit:search', _("LinkSearch")); $instructions = _("Search in pages for links with the matching name."); - $form = HTML::form(array('action' => $action, + return HTML::form(array('action' => $action, 'method' => 'get', 'accept-charset' => 'UTF-8'), $dirsign_switch, @@ -123,7 +123,6 @@ $query, HTML::raw(' '), $direction, HTML::raw(' '), $submit); - return $form; } /** Modified: trunk/lib/plugin/ListPages.php =================================================================== --- trunk/lib/plugin/ListPages.php 2021-09-20 07:56:53 UTC (rev 10572) +++ trunk/lib/plugin/ListPages.php 2021-09-20 08:23:20 UTC (rev 10573) @@ -149,7 +149,6 @@ function _getValue($page_handle, $revision_handle) { $iter = $page_handle->getLinks($this->_direction); - $count = $iter->count(); - return $count; + return $iter->count(); } } Modified: trunk/lib/plugin/ListSubpages.php =================================================================== --- trunk/lib/plugin/ListSubpages.php 2021-09-20 07:56:53 UTC (rev 10572) +++ trunk/lib/plugin/ListSubpages.php 2021-09-20 08:23:20 UTC (rev 10573) @@ -141,7 +141,6 @@ function _getValue($page_handle, $revision_handle) { $iter = $page_handle->getBackLinks(); - $count = $iter->count(); - return $count; + return $iter->count(); } } Modified: trunk/lib/plugin/RawHtml.php =================================================================== --- trunk/lib/plugin/RawHtml.php 2021-09-20 07:56:53 UTC (rev 10572) +++ trunk/lib/plugin/RawHtml.php 2021-09-20 08:23:20 UTC (rev 10573) @@ -182,8 +182,7 @@ // anything with ="javascript: is right out -- strip all tags and return if found $pattern = "/=\s*\S+script:\S+/Ui"; if (preg_match($pattern, $html)) { - $html = strip_tags($html); - return $html; + return strip_tags($html); } // setup -- $allowedtags is an array of $tag=>$closeit pairs, where $tag is an HTML tag to allow and $closeit is 1 if the tag requires a matching, closing tag Modified: trunk/lib/plugin/SemanticSearchAdvanced.php =================================================================== --- trunk/lib/plugin/SemanticSearchAdvanced.php 2021-09-20 07:56:53 UTC (rev 10572) +++ trunk/lib/plugin/SemanticSearchAdvanced.php 2021-09-20 08:23:20 UTC (rev 10573) @@ -109,7 +109,7 @@ $submit = Button('submit:semsearch[relations]', _("Search"), false, array('title' => 'Move to help page. No separate window')); $instructions = _("Search in all specified pages for the expression."); - $form = HTML::form(array('action' => $action, + return HTML::form(array('action' => $action, 'method' => 'post', 'accept-charset' => 'UTF-8'), $reldef, @@ -123,7 +123,6 @@ $querybox))), HTML::br(), HTML::div(array('class' => 'align-center'), $submit)); - return $form; } /** Modified: trunk/lib/plugin/SystemInfo.php =================================================================== --- trunk/lib/plugin/SystemInfo.php 2021-09-20 07:56:53 UTC (rev 10572) +++ trunk/lib/plugin/SystemInfo.php 2021-09-20 08:23:20 UTC (rev 10573) @@ -168,8 +168,7 @@ // Any useful numbers similar to a VisualWiki interestmap? function linkstats() { - $s = _("not yet"); - return $s; + return _("not yet"); } // number of homepages: easy Modified: trunk/lib/plugin/UriResolver.php =================================================================== --- trunk/lib/plugin/UriResolver.php 2021-09-20 07:56:53 UTC (rev 10572) +++ trunk/lib/plugin/UriResolver.php 2021-09-20 08:23:20 UTC (rev 10573) @@ -69,7 +69,6 @@ unset($args['start_debug']); // FIXME: ?Test=1 => Test $arg = join("/", array_keys($args)); - $xmlid = RdfWriter::makeXMLExportId($arg); - return $xmlid; + return RdfWriter::makeXMLExportId($arg); } } Modified: trunk/lib/plugin/VisualWiki.php =================================================================== --- trunk/lib/plugin/VisualWiki.php 2021-09-20 07:56:53 UTC (rev 10572) +++ trunk/lib/plugin/VisualWiki.php 2021-09-20 08:23:20 UTC (rev 10573) @@ -605,8 +605,7 @@ if ($promille * 1000 < $pro) return $col; } - $lastcol = end($this->ColorTab); - return $lastcol; + return end($this->ColorTab); } } Modified: trunk/lib/plugin/WikiAdminSetAclSimple.php =================================================================== --- trunk/lib/plugin/WikiAdminSetAclSimple.php 2021-09-20 07:56:53 UTC (rev 10572) +++ trunk/lib/plugin/WikiAdminSetAclSimple.php 2021-09-20 08:23:20 UTC (rev 10573) @@ -130,7 +130,7 @@ private function liberalPerms() { - $perm = array('view' => array(ACL_EVERY => true), + return array('view' => array(ACL_EVERY => true), 'edit' => array(ACL_EVERY => true), 'create' => array(ACL_EVERY => true), 'list' => array(ACL_EVERY => true), @@ -142,7 +142,6 @@ ACL_OWNER => true), 'change' => array(ACL_ADMIN => true, ACL_OWNER => true)); - return $perm; } /* @@ -156,7 +155,7 @@ private function restrictedPerms() { - $perm = array('view' => array(ACL_AUTHENTICATED => true, + return array('view' => array(ACL_AUTHENTICATED => true, ACL_EVERY => false), 'edit' => array(ACL_AUTHENTICATED => true, ACL_EVERY => false), @@ -172,7 +171,6 @@ ACL_OWNER => true), 'change' => array(ACL_ADMIN => true, ACL_OWNER => true)); - return $perm; } function setaclFormSimple(&$header, $pagehash) Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2021-09-20 07:56:53 UTC (rev 10572) +++ trunk/lib/stdlib.php 2021-09-20 08:23:20 UTC (rev 10573) @@ -381,8 +381,7 @@ { // FIXME: Is this needed (or sufficient?) if (!IsSafeURL($url)) { - $link = HTML::span(array('class' => 'error'), _('Bad URL').' -- '._('Remove all of <, >, "')); - return $link; + return HTML::span(array('class' => 'error'), _('Bad URL').' -- '._('Remove all of <, >, "')); } else { if (!$linktext) $linktext = preg_replace("/mailto:/A", "", $url); @@ -419,8 +418,7 @@ $arr = explode(' ', $url); if (!empty($arr)) $url = $arr[0]; if (!IsSafeURL($url)) { - $link = HTML::span(array('class' => 'error'), _('Bad URL for image').' -- '._('Remove all of <, >, "')); - return $link; + return HTML::span(array('class' => 'error'), _('Bad URL for image').' -- '._('Remove all of <, >, "')); } // spaces in inline images must be %20 encoded! $link = HTML::img(array('src' => $url)); @@ -471,10 +469,9 @@ } } else { $url = substr(strrchr($ori_url, "/"), 1); - $link = HTML::span(array('class' => 'error'), + return HTML::span(array('class' => 'error'), sprintf(_("Invalid attribute %s=%s for image %s"), $attr, $value, $url)); - return $link; } } // Correct silently the most common error @@ -508,9 +505,8 @@ ($height < 3 and $width < 20) or ($height < 7 and $width < 7) ) { - $link = HTML::span(array('class' => 'error'), + return HTML::span(array('class' => 'error'), _("Invalid image size")); - return $link; } } else { $size = 0; @@ -545,9 +541,8 @@ or ($height < 3 and $width < 20) or ($height < 7 and $width < 7) ) { - $link = HTML::span(array('class' => 'error'), + return HTML::span(array('class' => 'error'), _("Invalid image size")); - return $link; } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-09-20 07:56:54
|
Revision: 10572 http://sourceforge.net/p/phpwiki/code/10572 Author: vargenau Date: 2021-09-20 07:56:53 +0000 (Mon, 20 Sep 2021) Log Message: ----------- Simplify initialisation of toc counter Modified Paths: -------------- trunk/lib/plugin/CreateToc.php Modified: trunk/lib/plugin/CreateToc.php =================================================================== --- trunk/lib/plugin/CreateToc.php 2021-09-17 16:35:51 UTC (rev 10571) +++ trunk/lib/plugin/CreateToc.php 2021-09-20 07:56:53 UTC (rev 10572) @@ -70,13 +70,6 @@ ); } - // Initialisation of toc counter - private function initTocCounter() - { - $counter = array(1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0); - return $counter; - } - // Update toc counter with a new title private function tocCounter(&$counter, $level) { @@ -258,7 +251,7 @@ $counter, $levels, $firstlevelstyle, $basepage) { if (!$levels) $levels = array(1, 2); - $tocCounter = $this->initTocCounter(); + $tocCounter = array(1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0); reset($levels); sort($levels); $headers = array(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-09-17 16:35:53
|
Revision: 10571 http://sourceforge.net/p/phpwiki/code/10571 Author: vargenau Date: 2021-09-17 16:35:51 +0000 (Fri, 17 Sep 2021) Log Message: ----------- No break needed after return Modified Paths: -------------- trunk/lib/WikiGroup.php trunk/lib/plugin/FileInfo.php Modified: trunk/lib/WikiGroup.php =================================================================== --- trunk/lib/WikiGroup.php 2021-09-17 16:25:37 UTC (rev 10570) +++ trunk/lib/WikiGroup.php 2021-09-17 16:35:51 UTC (rev 10571) @@ -112,10 +112,8 @@ switch (GROUP_METHOD) { case "NONE": return new GroupNone($not_current); - break; case "WIKIPAGE": return new GroupWikiPage($not_current); - break; case "DB": if ($GLOBALS['DBParams']['dbtype'] == 'SQL') { return new GroupDb_PearDB($not_current); @@ -127,10 +125,8 @@ break; case "FILE": return new GroupFile($not_current); - break; case "LDAP": return new GroupLDAP($not_current); - break; default: trigger_error(_("No or unsupported GROUP_METHOD defined"), E_USER_WARNING); return new WikiGroup($not_current); Modified: trunk/lib/plugin/FileInfo.php =================================================================== --- trunk/lib/plugin/FileInfo.php 2021-09-17 16:25:37 UTC (rev 10570) +++ trunk/lib/plugin/FileInfo.php 2021-09-17 16:35:51 UTC (rev 10571) @@ -161,7 +161,6 @@ } else { return HTML::raw(''); } - break; } } chdir($dir); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-09-17 16:25:38
|
Revision: 10570 http://sourceforge.net/p/phpwiki/code/10570 Author: vargenau Date: 2021-09-17 16:25:37 +0000 (Fri, 17 Sep 2021) Log Message: ----------- Add missing sprintf Modified Paths: -------------- trunk/lib/WikiUser/POP3.php Modified: trunk/lib/WikiUser/POP3.php =================================================================== --- trunk/lib/WikiUser/POP3.php 2021-09-17 15:06:32 UTC (rev 10569) +++ trunk/lib/WikiUser/POP3.php 2021-09-17 16:25:37 UTC (rev 10570) @@ -78,7 +78,7 @@ fgets($fp, 1024); fclose($fp); } else { - trigger_error(_("Couldn't connect to %s", "POP3_AUTH_HOST " . $host . ':' . $port), + trigger_error(sprintf(_("Couldn't connect to %s"), "POP3_AUTH_HOST " . $host . ':' . $port), E_USER_WARNING); } $this->_authmethod = 'POP3'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-09-17 15:06:35
|
Revision: 10569 http://sourceforge.net/p/phpwiki/code/10569 Author: vargenau Date: 2021-09-17 15:06:32 +0000 (Fri, 17 Sep 2021) Log Message: ----------- slashifyPath only takes a string Modified Paths: -------------- trunk/lib/FileFinder.php Modified: trunk/lib/FileFinder.php =================================================================== --- trunk/lib/FileFinder.php 2021-09-17 14:23:54 UTC (rev 10568) +++ trunk/lib/FileFinder.php 2021-09-17 15:06:32 UTC (rev 10569) @@ -69,30 +69,22 @@ /** * Force using '/' as path separator. - * Accepts array of paths also. * - * @param string|array $path - * @return string|array + * @param string $path + * @return string */ public function slashifyPath($path) { - if (is_array($path)) { - $result = array(); - foreach ($path as $dir) { - $result[] = $this->slashifyPath($dir); - } - return $result; + if (isWindows()) { + $from = "\\"; + // PHP is stupid enough to use \\ instead of \ + if (substr($path, 0, 2) != '\\\\') + $path = str_replace('\\\\', '\\', $path); + else // UNC paths + $path = '\\\\' . str_replace('\\\\', '\\', substr($path, 2)); + return strtr($path, $from, '/'); } else { - if (isWindows()) { - $from = "\\"; - // PHP is stupid enough to use \\ instead of \ - if (substr($path, 0, 2) != '\\\\') - $path = str_replace('\\\\', '\\', $path); - else // UNC paths - $path = '\\\\' . str_replace('\\\\', '\\', substr($path, 2)); - return strtr($path, $from, '/'); - } else - return $path; + return $path; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-09-17 14:23:56
|
Revision: 10568 http://sourceforge.net/p/phpwiki/code/10568 Author: vargenau Date: 2021-09-17 14:23:54 +0000 (Fri, 17 Sep 2021) Log Message: ----------- Replace forcePathSlashes by slashifyPath Modified Paths: -------------- trunk/lib/FileFinder.php Modified: trunk/lib/FileFinder.php =================================================================== --- trunk/lib/FileFinder.php 2021-09-17 14:16:43 UTC (rev 10567) +++ trunk/lib/FileFinder.php 2021-09-17 14:23:54 UTC (rev 10568) @@ -68,7 +68,7 @@ } /** - * Unify used pathsep character. + * Force using '/' as path separator. * Accepts array of paths also. * * @param string|array $path @@ -76,21 +76,10 @@ */ public function slashifyPath($path) { - return $this->forcePathSlashes($path); - } - - /** - * Force using '/' as path separator. - * - * @param string|array $path - * @return string|array - */ - public function forcePathSlashes($path) - { if (is_array($path)) { $result = array(); foreach ($path as $dir) { - $result[] = $this->forcePathSlashes($dir); + $result[] = $this->slashifyPath($dir); } return $result; } else { @@ -439,11 +428,11 @@ $wikipath = DATA_PATH; $wikipath = $finder->_strip_last_pathchar($wikipath); if (!$file) - return $finder->forcePathSlashes($wikipath); + return $finder->slashifyPath($wikipath); else - return $finder->forcePathSlashes($wikipath . '/' . $file); + return $finder->slashifyPath($wikipath . '/' . $file); } else { - return $finder->forcePathSlashes($file); + return $finder->slashifyPath($file); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-09-17 14:16:46
|
Revision: 10567 http://sourceforge.net/p/phpwiki/code/10567 Author: vargenau Date: 2021-09-17 14:16:43 +0000 (Fri, 17 Sep 2021) Log Message: ----------- Remove default values in functions Modified Paths: -------------- trunk/lib/WikiDB/backend/dbaBase.php trunk/lib/WikiDB/backend/file.php trunk/lib/WikiDB/backend.php Modified: trunk/lib/WikiDB/backend/dbaBase.php =================================================================== --- trunk/lib/WikiDB/backend/dbaBase.php 2021-09-17 14:10:33 UTC (rev 10566) +++ trunk/lib/WikiDB/backend/dbaBase.php 2021-09-17 14:16:43 UTC (rev 10567) @@ -161,8 +161,7 @@ if (!$result) return false; list(, , $packed) = explode(':', $result, 3); - $data = unserialize($packed); - return $data; + return unserialize($packed); } function update_pagedata($pagename, $newdata) @@ -296,7 +295,7 @@ } else return false; - $links = $this->_linkdb->get_links($pagename, false, false); + $links = $this->_linkdb->get_links($pagename, false); $data['pagename'] = $to; $this->_pagedb->set($to, (int)$version . ':' @@ -351,8 +350,7 @@ // fix broken pages if (!is_array($data) or empty($data)) { if (is_string($data) and ($vdata = @unserialize($data))) { - trigger_error("broken page version $pagename. Run Check WikiDB", - E_USER_NOTICE); + trigger_error("broken page version $pagename. Run Check WikiDB"); $data = $vdata; } else $data = array(); @@ -732,9 +730,9 @@ // fields are stored in versiondata $av = $dbi->_backend->get_latest_version($aname); $bv = $dbi->_backend->get_latest_version($bname); - $a = $dbi->_backend->get_versiondata($aname, $av, false); + $a = $dbi->_backend->get_versiondata($aname, $av); if (!$a) return -1; - $b = $dbi->_backend->get_versiondata($bname, $bv, false); + $b = $dbi->_backend->get_versiondata($bname, $bv); if (!$b or !isset($b[$field])) return 0; if (empty($a[$field])) return -1; if ((!isset($a[$field]) and !isset($b[$field])) or ($a[$field] === $b[$field])) { @@ -846,7 +844,7 @@ function set_links($page, $links) { - $oldlinks = $this->get_links($page, false, false); + $oldlinks = $this->get_links($page, false); if (!is_array($links)) { assert(empty($links)); Modified: trunk/lib/WikiDB/backend/file.php =================================================================== --- trunk/lib/WikiDB/backend/file.php 2021-09-17 14:10:33 UTC (rev 10566) +++ trunk/lib/WikiDB/backend/file.php 2021-09-17 14:16:43 UTC (rev 10567) @@ -464,8 +464,7 @@ // try to delete the latest version! // so check if an older version exist: if ($this->get_versiondata($pagename, - $this->get_previous_version($pagename, $version), - false) == false + $this->get_previous_version($pagename, $version)) == false ) { // there is no older version.... // so the completely page will be removed: Modified: trunk/lib/WikiDB/backend.php =================================================================== --- trunk/lib/WikiDB/backend.php 2021-09-17 14:10:33 UTC (rev 10566) +++ trunk/lib/WikiDB/backend.php 2021-09-17 14:16:43 UTC (rev 10567) @@ -494,9 +494,9 @@ global $request; $dbh = $request->getDbh(); - $iter = $dbh->getAllPages(false); + $iter = $dbh->getAllPages(); while ($page = $iter->next()) { - $current = $page->getCurrentRevision(true); + $current = $page->getCurrentRevision(); $pagename = $page->getName(); $meta = $current->_data; $version = $current->getVersion(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-09-17 14:10:36
|
Revision: 10566 http://sourceforge.net/p/phpwiki/code/10566 Author: vargenau Date: 2021-09-17 14:10:33 +0000 (Fri, 17 Sep 2021) Log Message: ----------- $sep is "/" Modified Paths: -------------- trunk/lib/FileFinder.php Modified: trunk/lib/FileFinder.php =================================================================== --- trunk/lib/FileFinder.php 2021-09-17 13:29:39 UTC (rev 10565) +++ trunk/lib/FileFinder.php 2021-09-17 14:10:33 UTC (rev 10566) @@ -101,7 +101,7 @@ $path = str_replace('\\\\', '\\', $path); else // UNC paths $path = '\\\\' . str_replace('\\\\', '\\', substr($path, 2)); - return strtr($path, $from, $sep); + return strtr($path, $from, '/'); } else return $path; } @@ -130,7 +130,7 @@ * Strip ending '/' or '\' from path. * * @param $path string Path. - * @return bool New path (destructive) + * @return string New path (destructive) */ public function _strip_last_pathchar(&$path) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-09-17 13:29:42
|
Revision: 10565 http://sourceforge.net/p/phpwiki/code/10565 Author: vargenau Date: 2021-09-17 13:29:39 +0000 (Fri, 17 Sep 2021) Log Message: ----------- Windows 95 and Mac OS classic are dead, we use "/" as separator Modified Paths: -------------- trunk/lib/FileFinder.php trunk/lib/IniConfig.php trunk/lib/loadsave.php trunk/lib/stdlib.php trunk/lib/upgrade.php Modified: trunk/lib/FileFinder.php =================================================================== --- trunk/lib/FileFinder.php 2021-09-17 13:25:45 UTC (rev 10564) +++ trunk/lib/FileFinder.php 2021-09-17 13:29:39 UTC (rev 10565) @@ -37,14 +37,13 @@ */ class FileFinder { - public $_pathsep, $_path; + public $_path; /** - * @param $path array A list of directories in which to search for files. + * @param array $path A list of directories in which to search for files. */ function __construct($path = array()) { - $this->_pathsep = $this->_get_syspath_separator(); if (!isset($this->_path) and $path === false) $path = $this->_get_include_path(); $this->_path = $path; @@ -53,9 +52,9 @@ /** * Find file. * - * @param $file string File to search for. + * @param string $file File to search for. * @param bool $missing_okay - * @return string The filename (including path), if found, otherwise false. + * @return string|bool The filename (including path), if found, otherwise false. */ public function findFile($file, $missing_okay = false) { @@ -63,7 +62,7 @@ if (file_exists($file)) return $file; } elseif (($dir = $this->_search_path($file))) { - return $dir . $this->_use_path_separator($dir) . $file; + return $dir . '/' . $file; } return $missing_okay ? false : $this->_not_found($file); } @@ -71,42 +70,37 @@ /** * Unify used pathsep character. * Accepts array of paths also. - * This might not work on Windows95 or FAT volumes. (not tested) * - * @param string $path - * @return array|string + * @param string|array $path + * @return string|array */ public function slashifyPath($path) { - return $this->forcePathSlashes($path, $this->_pathsep); + return $this->forcePathSlashes($path); } /** * Force using '/' as path separator. * - * @param string $path - * @param string $sep - * @return array|string + * @param string|array $path + * @return string|array */ - public function forcePathSlashes($path, $sep = '/') + public function forcePathSlashes($path) { if (is_array($path)) { $result = array(); foreach ($path as $dir) { - $result[] = $this->forcePathSlashes($dir, $sep); + $result[] = $this->forcePathSlashes($dir); } return $result; } else { - if (isWindows() or $this->_isOtherPathsep()) { - if (isWindows()) $from = "\\"; - else $from = "\\"; + if (isWindows()) { + $from = "\\"; // PHP is stupid enough to use \\ instead of \ - if (isWindows()) { - if (substr($path, 0, 2) != '\\\\') - $path = str_replace('\\\\', '\\', $path); - else // UNC paths - $path = '\\\\' . str_replace('\\\\', '\\', substr($path, 2)); - } + if (substr($path, 0, 2) != '\\\\') + $path = str_replace('\\\\', '\\', $path); + else // UNC paths + $path = '\\\\' . str_replace('\\\\', '\\', substr($path, 2)); return strtr($path, $from, $sep); } else return $path; @@ -113,54 +107,10 @@ } } - private function _isOtherPathsep() - { - return $this->_pathsep != '/'; - } - /** - * The system-dependent path-separator character. - * UNIX,WindowsNT,MacOSX: / - * Windows95: \ - * Mac: : - * - * @return string path_separator. - */ - public function _get_syspath_separator() - { - if (!empty($this->_pathsep)) return $this->_pathsep; - elseif (isWindowsNT()) return "/"; // we can safely use '/' - elseif (isWindows()) return "\\"; // FAT might use '\' - // VMS or LispM is really weird, we ignore it. - else return '/'; - } - - /** - * The path-separator character of the given path. - * Windows accepts "/" also, but gets confused with mixed path_separators, - * e.g "C:\Apache\phpwiki/locale/button" - * > dir "C:\Apache\phpwiki/locale/button" => - * Parameterformat nicht korrekt - "locale" - * So if there's any '\' in the path, either fix them to '/' (not in Win95 or FAT?) - * or use '\' for ours. - * - * @param string $path - * @return string path_separator. - */ - public function _use_path_separator($path) - { - if (isWindows95()) { - if (empty($path)) return "\\"; - else return (strchr($path, "\\")) ? "\\" : '/'; - } else { - return $this->_get_syspath_separator(); - } - } - - /** * Determine if path is absolute. * - * @param $path string Path. + * @param string $path Path. * @return bool True if path is absolute. */ public function _is_abs($path) @@ -192,7 +142,7 @@ /** * Report a "file not found" error. * - * @param $file string Name of missing file. + * @param string $file Name of missing file. * @return bool false. */ private function _not_found($file) @@ -204,20 +154,13 @@ /** * Search our path for a file. * - * @param $file string File to find. - * @return string Directory which contains $file, or false. - * [5x,44ms] + * @param string $file string File to find. + * @return string|bool Directory which contains $file, or false. */ private function _search_path($file) { foreach ($this->_path as $dir) { - // ensure we use the same pathsep - if ($this->_isOtherPathsep()) { - $dir = $this->slashifyPath($dir); - $file = $this->slashifyPath($file); - if (file_exists($dir . $this->_pathsep . $file)) - return $dir; - } elseif (@file_exists($dir . $this->_pathsep . $file)) + if (@file_exists($dir . '/' . $file)) return $dir; } return false; @@ -258,7 +201,7 @@ * The directory is appended only if it is not already listed in * the include_path. * - * @param $dir string Directory to add. + * @param string $dir Directory to add. */ public function _append_to_include_path($dir) { @@ -286,7 +229,7 @@ * * The directory is prepended, and removed from the tail if already existing. * - * @param $dir string Directory to add. + * @param string $dir Directory to add. */ public function _prepend_to_include_path($dir) { @@ -300,10 +243,14 @@ @ini_set('include_path', $GLOBALS['INCLUDE_PATH']); } - // Return all the possible shortened locale specifiers for the given locale. - // Most specific first. - // de_DE.iso8859-1@euro => de_DE.iso8859-1, de_DE, de - // This code might needed somewhere else also. + /** + * Return all the possible shortened locale specifiers for the given locale. + * Most specific first. + * de_DE.iso8859-1@euro => de_DE.iso8859-1, de_DE, de + * This code might needed somewhere else also. + * + * @param string $lang Locale string + */ function locale_versions($lang) { // Try less specific versions of the locale @@ -357,7 +304,6 @@ { function __construct() { - $this->_pathsep = $this->_get_syspath_separator(); $include_path = $this->_get_include_path(); $path = array(); @@ -393,7 +339,6 @@ function __construct() { global $WikiTheme; - $this->_pathsep = $this->_get_syspath_separator(); $include_path = $this->_get_include_path(); $path = array(); @@ -476,9 +421,8 @@ if (defined("PHPWIKI_DIR")) $wikidir = PHPWIKI_DIR; else $wikidir = preg_replace('/.lib$/', '', dirname(__FILE__)); $wikidir = $finder->_strip_last_pathchar($wikidir); - $pathsep = $finder->_use_path_separator($wikidir); + $pathsep = '/'; return $finder->slashifyPath($wikidir . $pathsep . $file); - // return PHPWIKI_DIR . "/" . $file; } } @@ -509,24 +453,3 @@ if (isset($win)) return $win; return (substr(PHP_OS, 0, 3) == 'WIN'); } - -function isWindows95() -{ - static $win95; - if (isset($win95)) return $win95; - $win95 = isWindows() and !isWindowsNT(); - return $win95; -} - -function isWindowsNT() -{ - static $winnt; - if (isset($winnt)) return $winnt; - // FIXME: Do this using PHP_OS instead of php_uname(). - // $winnt = (PHP_OS == "WINNT"); // example from https://www.php.net/manual/en/ref.readline.php - if (function_usable('php_uname')) - $winnt = preg_match('/^Windows NT/', php_uname()); - else - $winnt = false; // FIXME: punt. - return $winnt; -} Modified: trunk/lib/IniConfig.php =================================================================== --- trunk/lib/IniConfig.php 2021-09-17 13:25:45 UTC (rev 10564) +++ trunk/lib/IniConfig.php 2021-09-17 13:29:39 UTC (rev 10565) @@ -120,7 +120,6 @@ // Optionally check config/config.php dump for faster startup $dump = substr($file, 0, -3) . "php"; - if (isWindows()) $dump = str_replace("/", "\\", $dump); if (file_exists($dump) and is_readable($dump) and filesize($dump) > 0 and sort_file_mtime($dump, $file) < 0) { @include($dump) or die("Error including " . $dump); if (function_exists('wiki_configrestore') and (wiki_configrestore() === 'noerr')) { @@ -862,8 +861,6 @@ // then bindtextdomain() fails, but after chdir to the correct path it will work okay. // 2. But the weird error "Undefined variable: bindtextdomain" is generated then. $bindtextdomain_path = findFile("locale", false, true); - if (isWindows()) - $bindtextdomain_path = str_replace("/", "\\", $bindtextdomain_path); $bindtextdomain_real = @bindtextdomain("phpwiki", $bindtextdomain_path); if (realpath($bindtextdomain_real) != realpath($bindtextdomain_path)) { // this will happen with virtual_paths. chdir and try again. @@ -876,7 +873,7 @@ if ($LANG != 'en') textdomain("phpwiki"); if ($chback) { // change back - chdir($bindtextdomain_real . (isWindows() ? "\\.." : "/..")); + chdir($bindtextdomain_real . "/.."); } } @@ -1011,8 +1008,6 @@ $SCRIPT_FILENAME = @$_ENV['SCRIPT_FILENAME']; if (!isset($SCRIPT_FILENAME)) $SCRIPT_FILENAME = dirname(__FILE__ . '/../') . '/index.php'; - if (isWindows()) - $SCRIPT_FILENAME = str_replace('\\\\', '\\', strtr($SCRIPT_FILENAME, '/', '\\')); define('SCRIPT_FILENAME', $SCRIPT_FILENAME); // Get remote host name, if Apache hasn't done it for us Modified: trunk/lib/loadsave.php =================================================================== --- trunk/lib/loadsave.php 2021-09-17 13:25:45 UTC (rev 10564) +++ trunk/lib/loadsave.php 2021-09-17 13:29:39 UTC (rev 10565) @@ -601,8 +601,6 @@ $request_args = $request->args; $timeout = (!$request->getArg('start_debug')) ? 60 : 240; if ($directory) { - if (isWindows()) - $directory = str_replace("\\", "/", $directory); // no Win95 support. if (!is_dir("$directory/images")) mkdir("$directory/images"); } @@ -661,7 +659,7 @@ if ($directory) mkdir_p($directory . "/" . $dirname); // Fails with "XX / YY", "XX" is created, "XX / YY" cannot be written - // if (isWindows()) // interesting Windows bug: cannot mkdir "bla " + // interesting Windows bug: cannot mkdir "bla " // Since dumps needs to be copied, we have to disallow this for all platforms. $filename = preg_replace("/ \//", "/", $filename); $relative_base = "../"; @@ -1565,10 +1563,10 @@ $epage = urlencode($page); if (!$dbi->isWikiPage($page)) { // translated version provided? - if ($lf = findLocalizedFile($pgsrc . $finder->_pathsep . $epage, 1)) { + if ($lf = findLocalizedFile($pgsrc . '/' . $epage, 1)) { LoadAny($request, $lf); } else { // load english version of required action page - LoadAny($request, findFile(DEFAULT_WIKI_PGSRC . $finder->_pathsep . urlencode($f))); + LoadAny($request, findFile(DEFAULT_WIKI_PGSRC . '/' . urlencode($f))); $page = $f; } } Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2021-09-17 13:25:45 UTC (rev 10564) +++ trunk/lib/stdlib.php 2021-09-17 13:29:39 UTC (rev 10565) @@ -1385,7 +1385,6 @@ $this->_pcre_pattern = glob_to_pcre($this->_pattern); } $this->_case = !isWindows(); - $this->_pathsep = '/'; if (empty($directory) or !file_exists($directory) or !is_dir($directory)) { return; // early return @@ -1397,7 +1396,7 @@ } while ($filename = readdir($dir_handle)) { - if ($filename[0] == '.' || filetype($dir . $this->_pathsep . $filename) != 'file') + if ($filename[0] == '.' || filetype($dir . '/' . $filename) != 'file') continue; if ($this->_filenameSelector($filename)) { array_push($this->_fileList, "$filename"); Modified: trunk/lib/upgrade.php =================================================================== --- trunk/lib/upgrade.php 2021-09-17 13:25:45 UTC (rev 10564) +++ trunk/lib/upgrade.php 2021-09-17 13:29:39 UTC (rev 10565) @@ -237,14 +237,11 @@ if (is_writable($filename)) { $in = fopen($filename, "rb"); $out = fopen($tmp = tempnam(getUploadFilePath(), "cfg"), "wb"); - if (isWindows()) - $tmp = str_replace("/", "\\", $tmp); // Detect the existing linesep at first line. fgets strips it even if 'rb'. // Before we simply assumed \r\n on Windows local files. $s = fread($in, 1024); rewind($in); $linesep = (substr_count($s, "\r\n") > substr_count($s, "\n")) ? "\r\n" : "\n"; - //$linesep = isWindows() ? "\r\n" : "\n"; while ($s = fgets($in)) { // =>php-5.0.1 can fill count //$new = preg_replace($match, $replace, $s, -1, $count); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-09-17 13:25:47
|
Revision: 10564 http://sourceforge.net/p/phpwiki/code/10564 Author: vargenau Date: 2021-09-17 13:25:45 +0000 (Fri, 17 Sep 2021) Log Message: ----------- Better test with array_key_exists to avoid warning Modified Paths: -------------- trunk/lib/WikiDB/backend/dbaBase.php Modified: trunk/lib/WikiDB/backend/dbaBase.php =================================================================== --- trunk/lib/WikiDB/backend/dbaBase.php 2021-09-17 11:14:06 UTC (rev 10563) +++ trunk/lib/WikiDB/backend/dbaBase.php 2021-09-17 13:25:45 UTC (rev 10564) @@ -819,12 +819,12 @@ $links = $this->_get_links($reversed ? 'i' : 'o', $page); $linksonly = array(); foreach ($links as $link) { // linkto => page, linkrelation => page - if (is_array($link) and isset($link['relation'])) { + if (is_array($link) and array_key_exists('relation', $link)) { if ($link['relation']) $this->found_relations++; $linksonly[] = array('pagename' => $link['linkto'], 'linkrelation' => $link['relation']); - } else { // empty relations are stripped + } elseif (array_key_exists('linkto', $link)) { // empty relations are stripped $linksonly[] = array('pagename' => $link['linkto']); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-09-17 11:14:08
|
Revision: 10563 http://sourceforge.net/p/phpwiki/code/10563 Author: vargenau Date: 2021-09-17 11:14:06 +0000 (Fri, 17 Sep 2021) Log Message: ----------- db4 is the default DBA handler Modified Paths: -------------- trunk/INSTALL trunk/config/config-default.ini trunk/config/config-dist.ini trunk/configurator.php trunk/lib/DbSession/dba.php trunk/lib/DbaDatabase.php trunk/lib/WikiDB/backend/dba.php trunk/lib/WikiDB/backend/dbaBase.php trunk/lib/WikiDB.php Modified: trunk/INSTALL =================================================================== --- trunk/INSTALL 2021-09-17 11:09:28 UTC (rev 10562) +++ trunk/INSTALL 2021-09-17 11:14:06 UTC (rev 10563) @@ -91,10 +91,10 @@ "Fatal error: Call to undefined function: dba_open() in phpwiki/lib/DbaDatabase.php on line 32" -To correct this you will have to check the available dba handlers -(default: db3 for Windows, otherwise gdbm), install the dba extension -or preferably an sql-compatible database such as MySQL or PostgreSQL -and make the necessary configuration changes to 'lib/config/config.ini'. +To correct this you will have to check the available dba handlers, +install the dba extension or preferably an sql-compatible database +such as MySQL or PostgreSQL and make the necessary configuration +changes to 'lib/config/config.ini'. INSTRUCTIONS Modified: trunk/config/config-default.ini =================================================================== --- trunk/config/config-default.ini 2021-09-17 11:09:28 UTC (rev 10562) +++ trunk/config/config-default.ini 2021-09-17 11:14:06 UTC (rev 10563) @@ -60,7 +60,7 @@ DATABASE_PREFIX = "" DATABASE_SESSION_TABLE = session DATABASE_DIRECTORY = /tmp -DATABASE_DBA_HANDLER = gdbm +DATABASE_DBA_HANDLER = db4 DATABASE_TIMEOUT = 20 DATABASE_OPTIMISE_FREQUENCY = 50 DATABASE_PERSISTENT = false Modified: trunk/config/config-dist.ini =================================================================== --- trunk/config/config-dist.ini 2021-09-17 11:09:28 UTC (rev 10562) +++ trunk/config/config-dist.ini 2021-09-17 11:14:06 UTC (rev 10563) @@ -447,13 +447,11 @@ DATABASE_DIRECTORY = /tmp ; For the dba backend, this defines which DBA variant you wish to use. -; gdbm - commonly available, Fedora not. Not recommended anymore. -; db2 - Berkeley DB v2; not supported by modern versions of PHP. -; db3 - Berkeley DB v3; as per db2. The best on Windows. -; db4 - Berkeley DB v4; current version, however PHP has some issues -; with its db4 support. -; dbm - Older dba handler; suffers from limits on the size of data -; items. +; gdbm - commonly available, Fedora not. Not recommended anymore. +; db2 - Berkeley DB v2; not supported by modern versions of PHP. +; db3 - Berkeley DB v3; as per db2. The best on Windows. +; db4 - Berkeley DB v4; current version. Default. +; dbm - Older dba handler; suffers from limits on the size of data items. ; Better not use other hacks such as inifile, flatfile or cdb. DATABASE_DBA_HANDLER = db4 Modified: trunk/configurator.php =================================================================== --- trunk/configurator.php 2021-09-17 11:09:28 UTC (rev 10562) +++ trunk/configurator.php 2021-09-17 11:14:06 UTC (rev 10563) @@ -793,10 +793,10 @@ $properties["dba handler"] = new _define_selection('DATABASE_DBA_HANDLER', array('gdbm' => "gdbm - GNU database manager (not recommended anymore)", - 'dbm' => "DBM - Redhat default. On sf.net there's dbm and not gdbm anymore", + 'dbm' => "DBM - Redhat default.", 'db2' => "DB2 - BerkeleyDB (Sleepycat) DB2", 'db3' => "DB3 - BerkeleyDB (Sleepycat) DB3. Default on Windows but not on every Linux", - 'db4' => "DB4 - BerkeleyDB (Sleepycat) DB4."), " + 'db4' => "DB4 - BerkeleyDB (Sleepycat) DB4. Default."), " Use 'gdbm', 'dbm', 'db2', 'db3' or 'db4' depending on your DBA handler methods supported: <br /> " . join(", ", dba_handlers()) . "\n\nBetter not use other hacks such as inifile, flatfile or cdb"); Modified: trunk/lib/DbSession/dba.php =================================================================== --- trunk/lib/DbSession/dba.php 2021-09-17 11:09:28 UTC (rev 10562) +++ trunk/lib/DbSession/dba.php 2021-09-17 11:14:06 UTC (rev 10563) @@ -66,7 +66,7 @@ if (!$dbh) { $directory = '/tmp'; $prefix = 'wiki_'; - $dba_handler = 'gdbm'; + $dba_handler = 'db4'; $timeout = 12; extract($DBParams); // overwrite the defaults $dbfile = "$directory/$prefix" . 'session' . '.' . $dba_handler; Modified: trunk/lib/DbaDatabase.php =================================================================== --- trunk/lib/DbaDatabase.php 2021-09-17 11:09:28 UTC (rev 10562) +++ trunk/lib/DbaDatabase.php 2021-09-17 11:14:06 UTC (rev 10563) @@ -48,7 +48,7 @@ * @param bool $mode * @param string $handler */ - function __construct($filename, $mode = false, $handler = 'gdbm') + function __construct($filename, $mode = false, $handler = 'db4') { $this->_file = $filename; $this->_handler = $handler; @@ -96,10 +96,7 @@ } if ((strlen($mode) == 1)) { - // PHP 4.3.x Windows lock bug workaround: http://bugs.php.net/bug.php?id=23975 - if (isWindows()) { - $mode .= "-"; // suppress locking, or - } elseif ($this->_handler != 'gdbm') { // gdbm does it internally + if ($this->_handler != 'gdbm') { // gdbm does it internally $mode .= "d"; // else use internal locking } } Modified: trunk/lib/WikiDB/backend/dba.php =================================================================== --- trunk/lib/WikiDB/backend/dba.php 2021-09-17 11:09:28 UTC (rev 10562) +++ trunk/lib/WikiDB/backend/dba.php 2021-09-17 11:14:06 UTC (rev 10563) @@ -34,7 +34,7 @@ { $directory = '/tmp'; $prefix = 'wiki_'; - $dba_handler = 'gdbm'; + $dba_handler = 'db4'; $timeout = 20; extract($dbparams); if ($directory) $directory .= "/"; Modified: trunk/lib/WikiDB/backend/dbaBase.php =================================================================== --- trunk/lib/WikiDB/backend/dbaBase.php 2021-09-17 11:09:28 UTC (rev 10562) +++ trunk/lib/WikiDB/backend/dbaBase.php 2021-09-17 11:14:06 UTC (rev 10563) @@ -26,9 +26,6 @@ require_once 'lib/WikiDB/backend.php'; -// FIXME:padding of data? Is it needed? dba_optimize() seems to do a good -// job at packing 'gdbm' (and 'db2') databases. - /* * Tables: * Modified: trunk/lib/WikiDB.php =================================================================== --- trunk/lib/WikiDB.php 2021-09-17 11:09:28 UTC (rev 10562) +++ trunk/lib/WikiDB.php 2021-09-17 11:14:06 UTC (rev 10563) @@ -143,8 +143,7 @@ * <dt> dba_handler * <dd> (Used by the dba backend.) * - * Which dba handler to use. Good choices are probably either - * 'gdbm' or 'db2'. + * Which dba handler to use. * * <dt> readonly * <dd> Either set by config.ini: READONLY = true or detected automatically This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-09-17 11:09:29
|
Revision: 10562 http://sourceforge.net/p/phpwiki/code/10562 Author: vargenau Date: 2021-09-17 11:09:28 +0000 (Fri, 17 Sep 2021) Log Message: ----------- Better test with array_key_exists to avoid warning Modified Paths: -------------- trunk/lib/WikiDB/backend/dbaBase.php Modified: trunk/lib/WikiDB/backend/dbaBase.php =================================================================== --- trunk/lib/WikiDB/backend/dbaBase.php 2021-09-17 11:07:11 UTC (rev 10561) +++ trunk/lib/WikiDB/backend/dbaBase.php 2021-09-17 11:09:28 UTC (rev 10562) @@ -497,7 +497,7 @@ $links = $linkdb->_get_links('o', substr($link, 1)); foreach ($links as $link) { // linkto => page, linkrelation => page if (is_array($link) - and $link['relation'] + and array_key_exists('relation', $link) and !in_array($link['relation'], $relations) ) { $is_attribute = empty($link['linkto']); // a relation has both This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-09-17 11:07:13
|
Revision: 10561 http://sourceforge.net/p/phpwiki/code/10561 Author: vargenau Date: 2021-09-17 11:07:11 +0000 (Fri, 17 Sep 2021) Log Message: ----------- Avoid PHP warning Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2021-09-17 10:48:53 UTC (rev 10560) +++ trunk/lib/PageList.php 2021-09-17 11:07:11 UTC (rev 10561) @@ -410,7 +410,7 @@ if (!empty($revision_handle->_data['%pagedata'])) { $revision_handle->_data['%pagedata']['_cached_html'] = ''; } - $c =&$revision_handle->getPackedContent(); + $c = $revision_handle->getPackedContent(); if ($this->_field == 'hi_content') { $search = $this->search; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-09-17 10:48:56
|
Revision: 10560 http://sourceforge.net/p/phpwiki/code/10560 Author: vargenau Date: 2021-09-17 10:48:53 +0000 (Fri, 17 Sep 2021) Log Message: ----------- lib/plugin/WikiAdminRename.php: avoid warning Modified Paths: -------------- trunk/lib/plugin/WikiAdminRename.php Modified: trunk/lib/plugin/WikiAdminRename.php =================================================================== --- trunk/lib/plugin/WikiAdminRename.php 2021-09-17 08:59:20 UTC (rev 10559) +++ trunk/lib/plugin/WikiAdminRename.php 2021-09-17 10:48:53 UTC (rev 10560) @@ -120,7 +120,7 @@ !empty($post_args['createredirect'])); } } - if ($post_args['action'] == 'select') { + if (is_array($post_args) && ($post_args['action'] == 'select')) { if (!empty($post_args['from'])) { $next_action = 'verify'; } @@ -133,9 +133,6 @@ $pages = $this->collectPages($pages, $dbi, $args['sortby'], $args['limit'], $args['exclude']); } - /*if ($next_action == 'verify') { - $args['info'] = "checkbox,pagename,renamed_pagename"; - }*/ $pagelist = new PageList_Selectable( $args['info'], $args['exclude'], array('types' => This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-09-17 08:59:22
|
Revision: 10559 http://sourceforge.net/p/phpwiki/code/10559 Author: vargenau Date: 2021-09-17 08:59:20 +0000 (Fri, 17 Sep 2021) Log Message: ----------- kcpralumni and mtswiki have upgraded to 1.6.0 Modified Paths: -------------- trunk/pgsrc/Help%2FWikisUsingPhpWiki Modified: trunk/pgsrc/Help%2FWikisUsingPhpWiki =================================================================== --- trunk/pgsrc/Help%2FWikisUsingPhpWiki 2021-09-16 17:56:48 UTC (rev 10558) +++ trunk/pgsrc/Help%2FWikisUsingPhpWiki 2021-09-17 08:59:20 UTC (rev 10559) @@ -1,4 +1,4 @@ -Date: Tue, 14 Sep 2021 12:20:51 +0000 +Date: Fri, 17 Sep 2021 10:38:33 +0000 Mime-Version: 1.0 (Produced by PhpWiki 1.6.0) Content-Type: application/x-phpwiki; pagename=Help%2FWikisUsingPhpWiki @@ -30,11 +30,11 @@ | http://gouwm.com/wiki/ | 1.2.11 | http://hollenback.net | 1.5.4 | Sidebar | http://joomlacode.org/gf/user/mat978/userwiki/ | | Gforge -| http://kcpralumni.org/wiki/ | 1.5.4 | Sidebar +| http://kcpralumni.org/wiki/ | 1.6.0 | Sidebar | http://kqlives.sourceforge.net/ | 1.3.14 | kq (custom) | http://matthieuachard.free.fr/wiki/ | 1.2.10 | http://meanwhile.sourceforge.net/wiki/ | 1.4.0RC1 | ~MonoBook -| http://mtswiki.westwood-tech.com/mtswiki-index.php/HomePage | 1.4.0RC1 | default +| http://mtswiki.westwood-tech.com/mtswiki-index.php/HomePage | 1.6.0 | Sidebar | http://mupad-combinat.sourceforge.net/Wiki/AboutWiki.html | | default | http://muthanna.com/looperng/tutorial/HelpPages.html | ?? (wikidump) | http://netfrag.org/rrr/wiki/ | 1.5.5 | Sidebar @@ -51,7 +51,7 @@ | http://utenmelk.no/wiki2/ | 1.6.0 | Wordpress | http://wac-tk.drni.de | 1.3.11p1 | Crao | https://wiki.cyberleo.net | 1.5.5 | MacOSX -| http://wiki.elaboratedsolutions.com +| http://wiki.elaboratedsolutions.com | 1.2.11 | http://wiki.wlug.org.nz | 1.3.11p1 | WLUG05 (custom) | http://www.allpsych.uni-giessen.de/wikidump/HomePage.html | ?? (wikidump) | http://www-bd.lip6.fr/ens/li345-2011/index.php/Accueil | 1.4.0RC1 | default This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-09-16 17:56:50
|
Revision: 10558 http://sourceforge.net/p/phpwiki/code/10558 Author: vargenau Date: 2021-09-16 17:56:48 +0000 (Thu, 16 Sep 2021) Log Message: ----------- Simplify call to rename_page Modified Paths: -------------- trunk/lib/WikiDB.php Modified: trunk/lib/WikiDB.php =================================================================== --- trunk/lib/WikiDB.php 2021-09-16 17:34:48 UTC (rev 10557) +++ trunk/lib/WikiDB.php 2021-09-16 17:56:48 UTC (rev 10558) @@ -573,21 +573,7 @@ } } } - if ($oldpage->exists() and !$newpage->exists()) { - if ($result = $this->_backend->rename_page($from, $to)) { - // create a RecentChanges entry with explaining summary - $page = $this->getPage($to); - $current = $page->getCurrentRevision(); - $meta = $current->_data; - $version = $current->getVersion(); - $meta['summary'] = sprintf(_("renamed from %s"), $from); - unset($meta['mtime']); // force new date - $page->save($current->getPackedContent(), $version + 1, $meta); - } - } elseif (!$oldpage->getCurrentRevision(false) and !$newpage->exists()) { - // if a version 0 exists try it also. - $result = $this->_backend->rename_page($from, $to); - } + $result = $this->_backend->rename_page($from, $to); /* Generate notification emails? */ if ($result and ENABLE_MAILNOTIFY) { $notify = $this->get('notify'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-09-16 17:34:51
|
Revision: 10557 http://sourceforge.net/p/phpwiki/code/10557 Author: vargenau Date: 2021-09-16 17:34:48 +0000 (Thu, 16 Sep 2021) Log Message: ----------- function rename_page is implemented in all backends Modified Paths: -------------- trunk/lib/WikiDB.php trunk/lib/plugin/WikiAdminRename.php trunk/locale/de/LC_MESSAGES/phpwiki.mo trunk/locale/es/LC_MESSAGES/phpwiki.mo trunk/locale/fr/LC_MESSAGES/phpwiki.mo trunk/locale/it/LC_MESSAGES/phpwiki.mo trunk/locale/ja/LC_MESSAGES/phpwiki.mo trunk/locale/nl/LC_MESSAGES/phpwiki.mo trunk/locale/po/de.po trunk/locale/po/es.po trunk/locale/po/fr.po trunk/locale/po/it.po trunk/locale/po/ja.po trunk/locale/po/nl.po trunk/locale/po/phpwiki.pot trunk/locale/po/sv.po trunk/locale/po/zh.po trunk/locale/sv/LC_MESSAGES/phpwiki.mo trunk/locale/zh/LC_MESSAGES/phpwiki.mo Modified: trunk/lib/WikiDB.php =================================================================== --- trunk/lib/WikiDB.php 2021-09-16 15:48:25 UTC (rev 10556) +++ trunk/lib/WikiDB.php 2021-09-16 17:34:48 UTC (rev 10557) @@ -544,16 +544,26 @@ assert(is_string($from) && $from != ''); assert(is_string($to) && $to != ''); $result = false; - if (method_exists($this->_backend, 'rename_page')) { - $oldpage = $this->getPage($from); - $newpage = $this->getPage($to); - //update all WikiLinks in existing pages - //non-atomic! i.e. if rename fails the links are not undone - if ($updateWikiLinks) { - $lookbehind = "/(?<=[\W:])\Q"; - $lookahead = "\E(?=[\W:])/"; - require_once 'lib/plugin/WikiAdminSearchReplace.php'; - $links = $oldpage->getBackLinks(); + $oldpage = $this->getPage($from); + $newpage = $this->getPage($to); + //update all WikiLinks in existing pages + //non-atomic! i.e. if rename fails the links are not undone + if ($updateWikiLinks) { + $lookbehind = "/(?<=[\W:])\Q"; + $lookahead = "\E(?=[\W:])/"; + require_once 'lib/plugin/WikiAdminSearchReplace.php'; + $links = $oldpage->getBackLinks(); + while ($linked_page = $links->next()) { + WikiPlugin_WikiAdminSearchReplace::replaceHelper + ($this, + $linked_page->getName(), + $lookbehind . $from . $lookahead, $to, + true, true); + } + // FIXME: Disabled to avoid recursive modification when renaming + // a page like 'PageFoo to 'PageFooTwo' + if (0) { + $links = $newpage->getBackLinks(); while ($linked_page = $links->next()) { WikiPlugin_WikiAdminSearchReplace::replaceHelper ($this, @@ -561,37 +571,22 @@ $lookbehind . $from . $lookahead, $to, true, true); } - // FIXME: Disabled to avoid recursive modification when renaming - // a page like 'PageFoo to 'PageFooTwo' - if (0) { - $links = $newpage->getBackLinks(); - while ($linked_page = $links->next()) { - WikiPlugin_WikiAdminSearchReplace::replaceHelper - ($this, - $linked_page->getName(), - $lookbehind . $from . $lookahead, $to, - true, true); - } - } } - if ($oldpage->exists() and !$newpage->exists()) { - if ($result = $this->_backend->rename_page($from, $to)) { - // create a RecentChanges entry with explaining summary - $page = $this->getPage($to); - $current = $page->getCurrentRevision(); - $meta = $current->_data; - $version = $current->getVersion(); - $meta['summary'] = sprintf(_("renamed from %s"), $from); - unset($meta['mtime']); // force new date - $page->save($current->getPackedContent(), $version + 1, $meta); - } - } elseif (!$oldpage->getCurrentRevision(false) and !$newpage->exists()) { - // if a version 0 exists try it also. - $result = $this->_backend->rename_page($from, $to); + } + if ($oldpage->exists() and !$newpage->exists()) { + if ($result = $this->_backend->rename_page($from, $to)) { + // create a RecentChanges entry with explaining summary + $page = $this->getPage($to); + $current = $page->getCurrentRevision(); + $meta = $current->_data; + $version = $current->getVersion(); + $meta['summary'] = sprintf(_("renamed from %s"), $from); + unset($meta['mtime']); // force new date + $page->save($current->getPackedContent(), $version + 1, $meta); } - } else { - trigger_error(_("WikiDB::renamePage() not yet implemented for this backend"), - E_USER_WARNING); + } elseif (!$oldpage->getCurrentRevision(false) and !$newpage->exists()) { + // if a version 0 exists try it also. + $result = $this->_backend->rename_page($from, $to); } /* Generate notification emails? */ if ($result and ENABLE_MAILNOTIFY) { Modified: trunk/lib/plugin/WikiAdminRename.php =================================================================== --- trunk/lib/plugin/WikiAdminRename.php 2021-09-16 15:48:25 UTC (rev 10556) +++ trunk/lib/plugin/WikiAdminRename.php 2021-09-16 17:34:48 UTC (rev 10557) @@ -240,7 +240,6 @@ $ul->pushContent(HTML::li(fmt("Access denied to rename page “%s”.", WikiLink($name)))); } elseif ($dbi->renamePage($name, $newname, $updatelinks)) { - /* not yet implemented for all backends */ $page = $dbi->getPage($newname); $current = $page->getCurrentRevision(); $version = $current->getVersion(); Modified: trunk/locale/de/LC_MESSAGES/phpwiki.mo =================================================================== (Binary files differ) Modified: trunk/locale/es/LC_MESSAGES/phpwiki.mo =================================================================== (Binary files differ) Modified: trunk/locale/fr/LC_MESSAGES/phpwiki.mo =================================================================== (Binary files differ) Modified: trunk/locale/it/LC_MESSAGES/phpwiki.mo =================================================================== (Binary files differ) Modified: trunk/locale/ja/LC_MESSAGES/phpwiki.mo =================================================================== (Binary files differ) Modified: trunk/locale/nl/LC_MESSAGES/phpwiki.mo =================================================================== (Binary files differ) Modified: trunk/locale/po/de.po =================================================================== --- trunk/locale/po/de.po 2021-09-16 15:48:25 UTC (rev 10556) +++ trunk/locale/po/de.po 2021-09-16 17:34:48 UTC (rev 10557) @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PhpWiki 1.6.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-03 19:05+0200\n" +"POT-Creation-Date: 2021-09-16 19:32+0200\n" "PO-Revision-Date: 2000-10-31 02:23+0200\n" "Last-Translator: Reini Urban <ru...@x-...>, Carsten Klapp " "<car...@us...>, Helmer Pardun <pardunpress@t-online." @@ -1375,6 +1375,9 @@ "Liste aller Versionen eines Autors mit Diff-Links, oder eine SeitenProtokoll-" "ähnliche Liste einer Seite nur für einen Autor." +msgid "You are not signed in and no author is specified." +msgstr "" + msgid "Minor" msgstr "kleinere" @@ -4682,9 +4685,6 @@ msgid "renamed from %s" msgstr "umbenannt von %s" -msgid "WikiDB::renamePage() not yet implemented for this backend" -msgstr "WikiDB::renamePage() für dieses Backend noch nicht implementiert" - #, php-format msgid "%s: Date of new revision is %s" msgstr "%s: Datum dieser aktuellen Neubearbeitung ist %s" Modified: trunk/locale/po/es.po =================================================================== --- trunk/locale/po/es.po 2021-09-16 15:48:25 UTC (rev 10556) +++ trunk/locale/po/es.po 2021-09-16 17:34:48 UTC (rev 10557) @@ -11,7 +11,7 @@ msgstr "" "Project-Id-Version: PhpWiki 1.6.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-03 19:05+0200\n" +"POT-Creation-Date: 2021-09-16 19:32+0200\n" "PO-Revision-Date: 2000-02-01 00:50-0500\n" "Last-Translator: Pablo Roca <pr...@cl...>\n" "Language-Team: \n" @@ -1349,6 +1349,9 @@ "PageHistory-like list of a single page for only one user." msgstr "" +msgid "You are not signed in and no author is specified." +msgstr "" + msgid "Minor" msgstr "" @@ -4556,9 +4559,6 @@ msgid "renamed from %s" msgstr "retitulado de %s" -msgid "WikiDB::renamePage() not yet implemented for this backend" -msgstr "WikiDB::renamePage() no todavía puesto en ejecucio'n para este backend" - #, php-format msgid "%s: Date of new revision is %s" msgstr "%s: La fecha de la nueva revisión es %s" Modified: trunk/locale/po/fr.po =================================================================== --- trunk/locale/po/fr.po 2021-09-16 15:48:25 UTC (rev 10556) +++ trunk/locale/po/fr.po 2021-09-16 17:34:48 UTC (rev 10557) @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PhpWiki 1.6.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-03 19:05+0200\n" +"POT-Creation-Date: 2021-09-16 19:32+0200\n" "PO-Revision-Date: 2004-06-22 21:10+0200\n" "Last-Translator: Pierrick Meignen <mei...@wa...>, Roland " "Trique <rol...@fr...>, Stéphane Gourichon <stephane.gourichon@lip6." @@ -1365,6 +1365,9 @@ "liste du type HistoriqueDeLaPage pour une simple page uniquement pour un " "auteur." +msgid "You are not signed in and no author is specified." +msgstr "Vous n'êtes pas identifié et il n'y a pas d'auteur spécifié." + msgid "Minor" msgstr "Mineur" @@ -4654,9 +4657,6 @@ msgid "renamed from %s" msgstr "renommée à partir de %s" -msgid "WikiDB::renamePage() not yet implemented for this backend" -msgstr "WikiBD::renamePage() pas encore implémentée pour le Principal" - #, php-format msgid "%s: Date of new revision is %s" msgstr "%s : la date de la nouvelle version est %s" Modified: trunk/locale/po/it.po =================================================================== --- trunk/locale/po/it.po 2021-09-16 15:48:25 UTC (rev 10556) +++ trunk/locale/po/it.po 2021-09-16 17:34:48 UTC (rev 10557) @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: PhpWiki 1.6.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-03 19:05+0200\n" +"POT-Creation-Date: 2021-09-16 19:32+0200\n" "PO-Revision-Date: 2005-02-12 16:23+0100\n" "Last-Translator: Antonio Bonifati ant[(at)]monitor.deis.unical.it\n" "Language-Team: \n" @@ -1332,6 +1332,9 @@ "PageHistory-like list of a single page for only one user." msgstr "" +msgid "You are not signed in and no author is specified." +msgstr "" + msgid "Minor" msgstr "" @@ -4530,9 +4533,6 @@ msgid "renamed from %s" msgstr "" -msgid "WikiDB::renamePage() not yet implemented for this backend" -msgstr "" - #, php-format msgid "%s: Date of new revision is %s" msgstr "" Modified: trunk/locale/po/ja.po =================================================================== --- trunk/locale/po/ja.po 2021-09-16 15:48:25 UTC (rev 10556) +++ trunk/locale/po/ja.po 2021-09-16 17:34:48 UTC (rev 10557) @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PhpWiki 1.6.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-03 19:05+0200\n" +"POT-Creation-Date: 2021-09-16 19:32+0200\n" "PO-Revision-Date: 2003-06-07 09:01+0900\n" "Last-Translator: Tadashi Jokagi <web...@el...>\n" "Language-Team: LANGUAGE <LL...@li...>\n" @@ -1318,6 +1318,9 @@ "PageHistory-like list of a single page for only one user." msgstr "" +msgid "You are not signed in and no author is specified." +msgstr "" + msgid "Minor" msgstr "" @@ -4516,9 +4519,6 @@ msgid "renamed from %s" msgstr "" -msgid "WikiDB::renamePage() not yet implemented for this backend" -msgstr "" - #, php-format msgid "%s: Date of new revision is %s" msgstr "" Modified: trunk/locale/po/nl.po =================================================================== --- trunk/locale/po/nl.po 2021-09-16 15:48:25 UTC (rev 10556) +++ trunk/locale/po/nl.po 2021-09-16 17:34:48 UTC (rev 10557) @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PhpWiki 1.6.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-03 19:05+0200\n" +"POT-Creation-Date: 2021-09-16 19:32+0200\n" "PO-Revision-Date: 2000-09-30 02:23+0200\n" "Last-Translator: Jan Nieuwenhuizen <ja...@gn...>\n" "Language-Team: Dutch <nl...@li...>\n" @@ -1324,6 +1324,9 @@ "PageHistory-like list of a single page for only one user." msgstr "" +msgid "You are not signed in and no author is specified." +msgstr "" + msgid "Minor" msgstr "" @@ -4522,9 +4525,6 @@ msgid "renamed from %s" msgstr "" -msgid "WikiDB::renamePage() not yet implemented for this backend" -msgstr "" - #, php-format msgid "%s: Date of new revision is %s" msgstr "" Modified: trunk/locale/po/phpwiki.pot =================================================================== --- trunk/locale/po/phpwiki.pot 2021-09-16 15:48:25 UTC (rev 10556) +++ trunk/locale/po/phpwiki.pot 2021-09-16 17:34:48 UTC (rev 10557) @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PhpWiki-1.6.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-03 19:05+0200\n" +"POT-Creation-Date: 2021-09-16 19:32+0200\n" "PO-Revision-Date: 2002-12-14 17:51-0500\n" "Last-Translator: Reini Urban <ru...@us...>\n" "Language-Team: LANGUAGE <LL...@li...>\n" @@ -1318,6 +1318,9 @@ "PageHistory-like list of a single page for only one user." msgstr "" +msgid "You are not signed in and no author is specified." +msgstr "" + msgid "Minor" msgstr "" @@ -4516,9 +4519,6 @@ msgid "renamed from %s" msgstr "" -msgid "WikiDB::renamePage() not yet implemented for this backend" -msgstr "" - #, php-format msgid "%s: Date of new revision is %s" msgstr "" Modified: trunk/locale/po/sv.po =================================================================== --- trunk/locale/po/sv.po 2021-09-16 15:48:25 UTC (rev 10556) +++ trunk/locale/po/sv.po 2021-09-16 17:34:48 UTC (rev 10557) @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: PhpWiki 1.6.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-03 19:05+0200\n" +"POT-Creation-Date: 2021-09-16 19:32+0200\n" "PO-Revision-Date: 2001-01-27 01:58+0200\n" "Last-Translator: Jon Åslund <jo...@he...>\n" "Language-Team: \n" @@ -1319,6 +1319,9 @@ "PageHistory-like list of a single page for only one user." msgstr "" +msgid "You are not signed in and no author is specified." +msgstr "" + msgid "Minor" msgstr "" @@ -4517,9 +4520,6 @@ msgid "renamed from %s" msgstr "" -msgid "WikiDB::renamePage() not yet implemented for this backend" -msgstr "" - #, php-format msgid "%s: Date of new revision is %s" msgstr "" Modified: trunk/locale/po/zh.po =================================================================== --- trunk/locale/po/zh.po 2021-09-16 15:48:25 UTC (rev 10556) +++ trunk/locale/po/zh.po 2021-09-16 17:34:48 UTC (rev 10557) @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PhpWiki 1.6.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-03 19:05+0200\n" +"POT-Creation-Date: 2021-09-16 19:32+0200\n" "PO-Revision-Date: 2004-04-21 10:08+0800\n" "Last-Translator: DruryL <dr...@us...>\n" "Language-Team: DruryL <dr...@us...>\n" @@ -1323,6 +1323,9 @@ "列出所有被使用者編輯的頁面修訂,並帶有差異連結,或顯示像是頁面歷程的單一頁面列" "表." +msgid "You are not signed in and no author is specified." +msgstr "" + msgid "Minor" msgstr "次要" @@ -4533,9 +4536,6 @@ msgid "renamed from %s" msgstr "從 %s 更名" -msgid "WikiDB::renamePage() not yet implemented for this backend" -msgstr "後台的 WikiDB::renamePage() 還沒實作出來." - #, php-format msgid "%s: Date of new revision is %s" msgstr "%s: 新版本的日期是 %s" Modified: trunk/locale/sv/LC_MESSAGES/phpwiki.mo =================================================================== (Binary files differ) Modified: trunk/locale/zh/LC_MESSAGES/phpwiki.mo =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-09-16 15:48:26
|
Revision: 10556 http://sourceforge.net/p/phpwiki/code/10556 Author: vargenau Date: 2021-09-16 15:48:25 +0000 (Thu, 16 Sep 2021) Log Message: ----------- Reorder functions in lib/WikiDB/backend.php Modified Paths: -------------- trunk/lib/WikiDB/backend.php Modified: trunk/lib/WikiDB/backend.php =================================================================== --- trunk/lib/WikiDB/backend.php 2021-09-16 15:23:40 UTC (rev 10555) +++ trunk/lib/WikiDB/backend.php 2021-09-16 15:48:25 UTC (rev 10556) @@ -68,7 +68,6 @@ * this is an abstract base class. It is expected that most efficient * backends will override nearly all the methods in this class. * - * @access protected * @see WikiDB */ @@ -165,46 +164,6 @@ abstract function get_versiondata($pagename, $version, $want_content = false); /** - * Rename page in the database. - * - * @param string $pagename Current page name - * @param string $to Future page name - */ - abstract function rename_page($pagename, $to); - - /** - * Delete page from the database with backup possibility. - * This should remove all links (from the named page) from - * the link database. - * - * @param string $pagename Page name. - * i.e save_page('') and DELETE nonempty id - * Can be undone and is seen in RecentChanges. - */ - abstract function delete_page($pagename); - - /** - * Delete page (and all its revisions) from the database. - * - * @param string $pagename Page name. - */ - abstract function purge_page($pagename); - - /** - * Delete an old revision of a page. - * - * Note that one is never allowed to delete the most recent version, - * but that this requirement is enforced by WikiDB not by the backend. - * - * In fact, to be safe, backends should probably allow the deletion of - * the most recent version. - * - * @param string $pagename Page name. - * @param int $version int Version to delete. - */ - abstract function delete_versiondata($pagename, $version); - - /** * Create a new page revision. * * If the given ($pagename,$version) is already in the database, @@ -230,7 +189,7 @@ * @param array $newdata hash New revision metadata. * @see set_versiondata, get_versiondata */ - function update_versiondata($pagename, $version, $newdata) + public function update_versiondata($pagename, $version, $newdata) { $data = $this->get_versiondata($pagename, $version, true); if (!$data) { @@ -247,14 +206,46 @@ } /** - * Set links for page. + * Delete an old revision of a page. * - * @param string $pagename Page name - * @param array $links List of page(names) which page links to. + * Note that one is never allowed to delete the most recent version, + * but that this requirement is enforced by WikiDB not by the backend. + * + * In fact, to be safe, backends should probably allow the deletion of + * the most recent version. + * + * @param string $pagename Page name. + * @param int $version int Version to delete. */ - abstract function set_links($pagename, $links); + abstract function delete_versiondata($pagename, $version); /** + * Rename page in the database. + * + * @param string $pagename Current page name + * @param string $to Future page name + */ + abstract function rename_page($pagename, $to); + + /** + * Delete page from the database with backup possibility. + * This should remove all links (from the named page) from + * the link database. + * + * @param string $pagename Page name. + * i.e save_page('') and DELETE nonempty id + * Can be undone and is seen in RecentChanges. + */ + abstract function delete_page($pagename); + + /** + * Delete page (and all its revisions) from the database. + * + * @param string $pagename Page name. + */ + abstract function purge_page($pagename); + + /** * Find pages which link to or are linked from a page. * * @param string $pagename Page name @@ -268,19 +259,25 @@ * FIXME: array or iterator? * @return object A WikiDB_backend_iterator. */ - - // FIXME: implement simple (but slow) link finder. abstract function get_links($pagename, $reversed = true, $include_empty = false, $sortby = '', $limit = '', $exclude = '', $want_relations = false); /** + * Set links for page. + * + * @param string $pagename Page name + * @param array $links List of page(names) which page links to. + */ + abstract function set_links($pagename, $links); + + /** * Get all revisions of a page. * * @param string $pagename The page name. * @return object A WikiDB_backend_iterator. */ - function get_all_revisions($pagename) + public function get_all_revisions($pagename) { include_once 'lib/WikiDB/backend/dumb/AllRevisionsIter.php'; return new WikiDB_backend_dumb_AllRevisionsIter($this, $pagename); @@ -406,7 +403,7 @@ return new WikiDB_backend_dumb_MostRecentIter($this, $pages, $params); } - function wanted_pages($exclude_from = '', $exclude = '', $sortby = '', $limit = '') + public function wanted_pages($exclude_from = '', $exclude = '', $sortby = '', $limit = '') { include_once 'lib/WikiDB/backend/dumb/WantedPagesIter.php'; $allpages = $this->get_all_pages(true, false, false, $exclude_from); @@ -448,7 +445,7 @@ * * This should flush all unwritten data to the filesystem. */ - function sync() + public function sync() { } @@ -457,7 +454,7 @@ * * @return bool */ - function optimize() + public function optimize() { return true; } @@ -474,7 +471,7 @@ * @param bool $args * @return bool True iff database is in a consistent state. */ - function check($args = false) + public function check($args = false) { return true; } @@ -489,7 +486,7 @@ * @param bool $args * @return bool True iff successful. */ - function rebuild($args = false) + public function rebuild($args = false) { /** * @var WikiRequest $request This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-09-16 15:23:42
|
Revision: 10555 http://sourceforge.net/p/phpwiki/code/10555 Author: vargenau Date: 2021-09-16 15:23:40 +0000 (Thu, 16 Sep 2021) Log Message: ----------- Move function delete_page from lib/WikiDB/backend.php to lib/WikiDB/backend/PearDB.php; all backends implement it Modified Paths: -------------- trunk/lib/WikiDB/backend/PearDB.php trunk/lib/WikiDB/backend.php Modified: trunk/lib/WikiDB/backend/PearDB.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB.php 2021-09-14 16:59:19 UTC (rev 10554) +++ trunk/lib/WikiDB/backend/PearDB.php 2021-09-16 15:23:40 UTC (rev 10555) @@ -939,6 +939,45 @@ return $id; } + /** + * Delete page from the database with backup possibility. + * This should remove all links (from the named page) from + * the link database. + * + * @param string $pagename Page name. + * i.e save_page('') and DELETE nonempty id + * Can be undone and is seen in RecentChanges. + */ + + function delete_page($pagename) + { + /** + * @var WikiRequest $request + */ + global $request; + + $mtime = time(); + $user =& $request->_user; + $vdata = array('author' => $user->getId(), + 'author_id' => $user->getAuthenticatedId(), + 'mtime' => $mtime); + + $this->lock(); // critical section: + $version = $this->get_latest_version($pagename); + $this->set_versiondata($pagename, $version + 1, $vdata); + $this->set_links($pagename, array()); // links are purged. + // SQL needs to invalidate the non_empty id + if (!WIKIDB_NOCACHE_MARKUP) { + // need the hits, perms and LOCKED, otherwise you can reset the perm + // by action=remove and re-create it with default perms + $pagedata = $this->get_pagedata($pagename); + unset($pagedata['_cached_html']); + $this->update_pagedata($pagename, $pagedata); + } + $this->unlock(); + } + + function _update_recent_table($pageid = false) { $dbh = &$this->_dbh; Modified: trunk/lib/WikiDB/backend.php =================================================================== --- trunk/lib/WikiDB/backend.php 2021-09-14 16:59:19 UTC (rev 10554) +++ trunk/lib/WikiDB/backend.php 2021-09-16 15:23:40 UTC (rev 10555) @@ -170,7 +170,6 @@ * @param string $pagename Current page name * @param string $to Future page name */ - abstract function rename_page($pagename, $to); /** @@ -182,34 +181,8 @@ * i.e save_page('') and DELETE nonempty id * Can be undone and is seen in RecentChanges. */ - function delete_page($pagename) - { - /** - * @var WikiRequest $request - */ - global $request; + abstract function delete_page($pagename); - $mtime = time(); - $user =& $request->_user; - $vdata = array('author' => $user->getId(), - 'author_id' => $user->getAuthenticatedId(), - 'mtime' => $mtime); - - $this->lock(); // critical section: - $version = $this->get_latest_version($pagename); - $this->set_versiondata($pagename, $version + 1, $vdata); - $this->set_links($pagename, array()); // links are purged. - // SQL needs to invalidate the non_empty id - if (!WIKIDB_NOCACHE_MARKUP) { - // need the hits, perms and LOCKED, otherwise you can reset the perm - // by action=remove and re-create it with default perms - $pagedata = $this->get_pagedata($pagename); - unset($pagedata['_cached_html']); - $this->update_pagedata($pagename, $pagedata); - } - $this->unlock(); - } - /** * Delete page (and all its revisions) from the database. * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-09-14 16:59:21
|
Revision: 10554 http://sourceforge.net/p/phpwiki/code/10554 Author: vargenau Date: 2021-09-14 16:59:19 +0000 (Tue, 14 Sep 2021) Log Message: ----------- Better check boolean arguments, default values might already be booleans, not strings Modified Paths: -------------- trunk/lib/plugin/AddComment.php trunk/lib/plugin/AllPages.php trunk/lib/plugin/AllUsers.php trunk/lib/plugin/AppendText.php trunk/lib/plugin/AtomFeed.php trunk/lib/plugin/AuthorHistory.php trunk/lib/plugin/BackLinks.php trunk/lib/plugin/CreatePage.php trunk/lib/plugin/CreateToc.php trunk/lib/plugin/DebugBackendInfo.php trunk/lib/plugin/ExternalSearch.php trunk/lib/plugin/FullTextSearch.php trunk/lib/plugin/IncludePage.php trunk/lib/plugin/LinkDatabase.php trunk/lib/plugin/LinkSearch.php trunk/lib/plugin/ListSubpages.php trunk/lib/plugin/MostPopular.php trunk/lib/plugin/NewPagesPerUser.php trunk/lib/plugin/OrphanedPages.php trunk/lib/plugin/PopularNearby.php trunk/lib/plugin/RandomPage.php trunk/lib/plugin/RecentReferrers.php trunk/lib/plugin/RssFeed.php trunk/lib/plugin/SearchHighlight.php trunk/lib/plugin/SemanticRelations.php trunk/lib/plugin/SemanticSearch.php trunk/lib/plugin/SemanticSearchAdvanced.php trunk/lib/plugin/TitleSearch.php trunk/lib/plugin/UserRatings.php trunk/lib/plugin/Video.php trunk/lib/plugin/WantedPages.php trunk/lib/plugin/WikiForum.php Modified: trunk/lib/plugin/AddComment.php =================================================================== --- trunk/lib/plugin/AddComment.php 2021-09-14 14:07:14 UTC (rev 10553) +++ trunk/lib/plugin/AddComment.php 2021-09-14 16:59:19 UTC (rev 10554) @@ -82,21 +82,25 @@ } $jshide = $args['jshide']; - if (($jshide == '0') || ($jshide == 'false')) { - $jshide = false; - } elseif (($jshide == '1') || ($jshide == 'true')) { - $jshide = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "jshide")); + if (!is_bool($jshide)) { + if (($jshide == '0') || ($jshide == 'false')) { + $jshide = false; + } elseif (($jshide == '1') || ($jshide == 'true')) { + $jshide = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "jshide")); + } } $noheader = $args['noheader']; - 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")); + if (!is_bool($noheader)) { + 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")); + } } // Get our form args. Modified: trunk/lib/plugin/AllPages.php =================================================================== --- trunk/lib/plugin/AllPages.php 2021-09-14 14:07:14 UTC (rev 10553) +++ trunk/lib/plugin/AllPages.php 2021-09-14 16:59:19 UTC (rev 10554) @@ -68,30 +68,36 @@ $args = $this->getArgs($argstr, $request); $include_empty = $args['include_empty']; - if (($include_empty == '0') || ($include_empty == 'false')) { - $include_empty = false; - } elseif (($include_empty == '1') || ($include_empty == 'true')) { - $include_empty = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "include_empty")); + if (!is_bool($include_empty)) { + if (($include_empty == '0') || ($include_empty == 'false')) { + $include_empty = false; + } elseif (($include_empty == '1') || ($include_empty == 'true')) { + $include_empty = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "include_empty")); + } } $noheader = $args['noheader']; - 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")); + if (!is_bool($noheader)) { + 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")); + } } $userpages = $args['userpages']; - if (($userpages == '0') || ($userpages == 'false')) { - $userpages = false; - } elseif (($userpages == '1') || ($userpages == 'true')) { - $userpages = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "userpages")); + if (!is_bool($userpages)) { + if (($userpages == '0') || ($userpages == 'false')) { + $userpages = false; + } elseif (($userpages == '1') || ($userpages == 'true')) { + $userpages = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "userpages")); + } } if (isset($args['limit']) && !is_limit($args['limit'])) { Modified: trunk/lib/plugin/AllUsers.php =================================================================== --- trunk/lib/plugin/AllUsers.php 2021-09-14 14:07:14 UTC (rev 10553) +++ trunk/lib/plugin/AllUsers.php 2021-09-14 16:59:19 UTC (rev 10554) @@ -78,12 +78,14 @@ extract($args); - if (($include_empty == '0') || ($include_empty == 'false')) { - $include_empty = false; - } elseif (($include_empty == '1') || ($include_empty == 'true')) { - $include_empty = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "include_empty")); + if (!is_bool($include_empty)) { + if (($include_empty == '0') || ($include_empty == 'false')) { + $include_empty = false; + } elseif (($include_empty == '1') || ($include_empty == 'true')) { + $include_empty = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "include_empty")); + } } $group = $request->getGroup(); Modified: trunk/lib/plugin/AppendText.php =================================================================== --- trunk/lib/plugin/AppendText.php 2021-09-14 14:07:14 UTC (rev 10553) +++ trunk/lib/plugin/AppendText.php 2021-09-14 16:59:19 UTC (rev 10554) @@ -72,12 +72,14 @@ $args = $this->getArgs($argstr, $request); $redirect = $args['redirect']; - if (($redirect == '0') || ($redirect == 'false')) { - $redirect = false; - } elseif (($redirect == '1') || ($redirect == 'true')) { - $redirect = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "redirect")); + if (!is_bool($redirect)) { + if (($redirect == '0') || ($redirect == 'false')) { + $redirect = false; + } elseif (($redirect == '1') || ($redirect == 'true')) { + $redirect = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "redirect")); + } } if (!$args['pages'] or !$request->isPost()) { Modified: trunk/lib/plugin/AtomFeed.php =================================================================== --- trunk/lib/plugin/AtomFeed.php 2021-09-14 14:07:14 UTC (rev 10553) +++ trunk/lib/plugin/AtomFeed.php 2021-09-14 16:59:19 UTC (rev 10554) @@ -59,12 +59,14 @@ { extract($this->getArgs($argstr, $request)); - if (($titleonly == '0') || ($titleonly == 'false')) { - $titleonly = false; - } elseif (($titleonly == '1') || ($titleonly == 'true')) { - $titleonly = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "titleonly")); + if (!is_bool($titleonly)) { + if (($titleonly == '0') || ($titleonly == 'false')) { + $titleonly = false; + } elseif (($titleonly == '1') || ($titleonly == 'true')) { + $titleonly = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "titleonly")); + } } $parser = new AtomParser(); Modified: trunk/lib/plugin/AuthorHistory.php =================================================================== --- trunk/lib/plugin/AuthorHistory.php 2021-09-14 14:07:14 UTC (rev 10553) +++ trunk/lib/plugin/AuthorHistory.php 2021-09-14 16:59:19 UTC (rev 10554) @@ -90,28 +90,34 @@ $this->_args = $this->getArgs($argstr, $request); extract($this->_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")); + if (!is_bool($noheader)) { + 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")); + } } - if (($includeminor == '0') || ($includeminor == 'false')) { - $includeminor = false; - } elseif (($includeminor == '1') || ($includeminor == 'true')) { - $includeminor = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "includeminor")); + if (!is_bool($includeminor)) { + if (($includeminor == '0') || ($includeminor == 'false')) { + $includeminor = false; + } elseif (($includeminor == '1') || ($includeminor == 'true')) { + $includeminor = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "includeminor")); + } } - if (($includedeleted == '0') || ($includedeleted == 'false')) { - $includedeleted = false; - } elseif (($includedeleted == '1') || ($includedeleted == 'true')) { - $includedeleted = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "includedeleted")); + if (!is_bool($includedeleted)) { + if (($includedeleted == '0') || ($includedeleted == 'false')) { + $includedeleted = false; + } elseif (($includedeleted == '1') || ($includedeleted == 'true')) { + $includedeleted = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "includedeleted")); + } } if (!$author) { // user not signed in and no author specified Modified: trunk/lib/plugin/BackLinks.php =================================================================== --- trunk/lib/plugin/BackLinks.php 2021-09-14 14:07:14 UTC (rev 10553) +++ trunk/lib/plugin/BackLinks.php 2021-09-14 16:59:19 UTC (rev 10554) @@ -68,20 +68,24 @@ extract($args); - if (($include_self == '0') || ($include_self == 'false')) { - $include_self = false; - } elseif (($include_self == '1') || ($include_self == 'true')) { - $include_self = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "include_self")); + if (!is_bool($include_self)) { + if (($include_self == '0') || ($include_self == 'false')) { + $include_self = false; + } elseif (($include_self == '1') || ($include_self == 'true')) { + $include_self = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "include_self")); + } } - 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")); + if (!is_bool($noheader)) { + 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")); + } } if (empty($page) and $page != '0') { Modified: trunk/lib/plugin/CreatePage.php =================================================================== --- trunk/lib/plugin/CreatePage.php 2021-09-14 14:07:14 UTC (rev 10553) +++ trunk/lib/plugin/CreatePage.php 2021-09-14 16:59:19 UTC (rev 10554) @@ -66,12 +66,14 @@ { extract($this->getArgs($argstr, $request)); - if (($overwrite == '0') || ($overwrite == 'false')) { - $overwrite = false; - } elseif (($overwrite == '1') || ($overwrite == 'true')) { - $overwrite = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "overwrite")); + if (!is_bool($overwrite)) { + if (($overwrite == '0') || ($overwrite == 'false')) { + $overwrite = false; + } elseif (($overwrite == '1') || ($overwrite == 'true')) { + $overwrite = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "overwrite")); + } } // Prevent spaces and slashes at the start and end of a page name Modified: trunk/lib/plugin/CreateToc.php =================================================================== --- trunk/lib/plugin/CreateToc.php 2021-09-14 14:07:14 UTC (rev 10553) +++ trunk/lib/plugin/CreateToc.php 2021-09-14 16:59:19 UTC (rev 10554) @@ -409,52 +409,64 @@ return $this->error(sprintf(_("A required argument “%s” is missing."), 'pagename')); } - if (($extracollapse == '0') || ($extracollapse == 'false')) { - $extracollapse = false; - } elseif (($extracollapse == '1') || ($extracollapse == 'true')) { - $extracollapse = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "extracollapse")); + if (!is_bool($extracollapse)) { + if (($extracollapse == '0') || ($extracollapse == 'false')) { + $extracollapse = false; + } elseif (($extracollapse == '1') || ($extracollapse == 'true')) { + $extracollapse = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "extracollapse")); + } } - if (($jshide == '0') || ($jshide == 'false')) { - $jshide = false; - } elseif (($jshide == '1') || ($jshide == 'true')) { - $jshide = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "jshide")); + if (!is_bool($jshide)) { + if (($jshide == '0') || ($jshide == 'false')) { + $jshide = false; + } elseif (($jshide == '1') || ($jshide == 'true')) { + $jshide = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "jshide")); + } } - 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")); + if (!is_bool($noheader)) { + 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")); + } } - if (($notoc == '0') || ($notoc == 'false')) { - $notoc = false; - } elseif (($notoc == '1') || ($notoc == 'true')) { - $notoc = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "notoc")); + if (!is_bool($notoc)) { + if (($notoc == '0') || ($notoc == 'false')) { + $notoc = false; + } elseif (($notoc == '1') || ($notoc == 'true')) { + $notoc = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "notoc")); + } } - if (($with_counter == '0') || ($with_counter == 'false')) { - $with_counter = false; - } elseif (($with_counter == '1') || ($with_counter == 'true')) { - $with_counter = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "with_counter")); + if (!is_bool($with_counter)) { + if (($with_counter == '0') || ($with_counter == 'false')) { + $with_counter = false; + } elseif (($with_counter == '1') || ($with_counter == 'true')) { + $with_counter = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "with_counter")); + } } - if (($with_toclink == '0') || ($with_toclink == 'false')) { - $with_toclink = false; - } elseif (($with_toclink == '1') || ($with_toclink == 'true')) { - $with_toclink = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "with_toclink")); + if (!is_bool($with_toclink)) { + if (($with_toclink == '0') || ($with_toclink == 'false')) { + $with_toclink = false; + } elseif (($with_toclink == '1') || ($with_toclink == 'true')) { + $with_toclink = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "with_toclink")); + } } if (($notoc) or ($liststyle == 'ol')) { Modified: trunk/lib/plugin/DebugBackendInfo.php =================================================================== --- trunk/lib/plugin/DebugBackendInfo.php 2021-09-14 14:07:14 UTC (rev 10553) +++ trunk/lib/plugin/DebugBackendInfo.php 2021-09-14 16:59:19 UTC (rev 10554) @@ -53,24 +53,30 @@ { $args = $this->getArgs($argstr, $request); extract($args); + if (empty($userid) or $userid == $request->_user->UserName()) { $user = $request->_user; } else { $user = WikiUser($userid); } + if (!$user->isAdmin() and !(DEBUG && _DEBUG_LOGIN)) { $request->_notAuthorized(WIKIAUTH_ADMIN); $this->disabled("! user->isAdmin"); } + if (empty($page)) { return $this->error("page missing"); } - if (($notallversions == '0') || ($notallversions == 'false')) { - $notallversions = false; - } elseif (($notallversions == '1') || ($notallversions == 'true')) { - $notallversions = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "notallversions")); + + if (!is_bool($notallversions)) { + if (($notallversions == '0') || ($notallversions == 'false')) { + $notallversions = false; + } elseif (($notallversions == '1') || ($notallversions == 'true')) { + $notallversions = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "notallversions")); + } } $backend = &$dbi->_backend; Modified: trunk/lib/plugin/ExternalSearch.php =================================================================== --- trunk/lib/plugin/ExternalSearch.php 2021-09-14 14:07:14 UTC (rev 10553) +++ trunk/lib/plugin/ExternalSearch.php 2021-09-14 16:59:19 UTC (rev 10554) @@ -92,12 +92,14 @@ extract($args); - if (($debug == '0') || ($debug == 'false')) { - $debug = false; - } elseif (($debug == '1') || ($debug == 'true')) { - $debug = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "debug")); + if (!is_bool($debug)) { + if (($debug == '0') || ($debug == 'false')) { + $debug = false; + } elseif (($debug == '1') || ($debug == 'true')) { + $debug = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "debug")); + } } $posted = $GLOBALS['HTTP_POST_VARS']; Modified: trunk/lib/plugin/FullTextSearch.php =================================================================== --- trunk/lib/plugin/FullTextSearch.php 2021-09-14 14:07:14 UTC (rev 10553) +++ trunk/lib/plugin/FullTextSearch.php 2021-09-14 16:59:19 UTC (rev 10554) @@ -78,36 +78,44 @@ } extract($args); - if (($hilight == '0') || ($hilight == 'false')) { - $hilight = false; - } elseif (($hilight == '1') || ($hilight == 'true')) { - $hilight = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "hilight")); + if (!is_bool($hilight)) { + if (($hilight == '0') || ($hilight == 'false')) { + $hilight = false; + } elseif (($hilight == '1') || ($hilight == 'true')) { + $hilight = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "hilight")); + } } - if (($case_exact == '0') || ($case_exact == 'false')) { - $case_exact = false; - } elseif (($case_exact == '1') || ($case_exact == 'true')) { - $case_exact = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "case_exact")); + if (!is_bool($case_exact)) { + if (($case_exact == '0') || ($case_exact == 'false')) { + $case_exact = false; + } elseif (($case_exact == '1') || ($case_exact == 'true')) { + $case_exact = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "case_exact")); + } } - 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")); + if (!is_bool($noheader)) { + 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")); + } } - if (($quiet == '0') || ($quiet == 'false')) { - $quiet = false; - } elseif (($quiet == '1') || ($quiet == 'true')) { - $quiet = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "quiet")); + if (!is_bool($quiet)) { + if (($quiet == '0') || ($quiet == 'false')) { + $quiet = false; + } elseif (($quiet == '1') || ($quiet == 'true')) { + $quiet = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "quiet")); + } } $query = new TextSearchQuery($s, $case_exact, $regex); Modified: trunk/lib/plugin/IncludePage.php =================================================================== --- trunk/lib/plugin/IncludePage.php 2021-09-14 14:07:14 UTC (rev 10553) +++ trunk/lib/plugin/IncludePage.php 2021-09-14 16:59:19 UTC (rev 10554) @@ -85,20 +85,24 @@ $args = $this->getArgs($argstr, $request); extract($args); - if (($quiet == '0') || ($quiet == 'false')) { - $quiet = false; - } elseif (($quiet == '1') || ($quiet == 'true')) { - $quiet = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "quiet")); + if (!is_bool($quiet)) { + if (($quiet == '0') || ($quiet == 'false')) { + $quiet = false; + } elseif (($quiet == '1') || ($quiet == 'true')) { + $quiet = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "quiet")); + } } - if (($sectionhead == '0') || ($sectionhead == 'false')) { - $sectionhead = false; - } elseif (($sectionhead == '1') || ($sectionhead == 'true')) { - $sectionhead = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "sectionhead")); + if (!is_bool($sectionhead)) { + if (($sectionhead == '0') || ($sectionhead == 'false')) { + $sectionhead = false; + } elseif (($sectionhead == '1') || ($sectionhead == 'true')) { + $sectionhead = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "sectionhead")); + } } if ($page) { Modified: trunk/lib/plugin/LinkDatabase.php =================================================================== --- trunk/lib/plugin/LinkDatabase.php 2021-09-14 14:07:14 UTC (rev 10553) +++ trunk/lib/plugin/LinkDatabase.php 2021-09-14 16:59:19 UTC (rev 10554) @@ -104,12 +104,14 @@ $args = $this->getArgs($argstr, $request); $include_empty = $args['include_empty']; - if (($include_empty == '0') || ($include_empty == 'false')) { - $include_empty = false; - } elseif (($include_empty == '1') || ($include_empty == 'true')) { - $include_empty = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "include_empty")); + if (!is_bool($include_empty)) { + if (($include_empty == '0') || ($include_empty == 'false')) { + $include_empty = false; + } elseif (($include_empty == '1') || ($include_empty == 'true')) { + $include_empty = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "include_empty")); + } } if (isset($args['limit']) && !is_limit($args['limit'])) { Modified: trunk/lib/plugin/LinkSearch.php =================================================================== --- trunk/lib/plugin/LinkSearch.php 2021-09-14 14:07:14 UTC (rev 10553) +++ trunk/lib/plugin/LinkSearch.php 2021-09-14 16:59:19 UTC (rev 10554) @@ -138,20 +138,24 @@ $args = $this->getArgs($argstr, $request); extract($args); - if (($noform == '0') || ($noform == 'false')) { - $noform = false; - } elseif (($noform == '1') || ($noform == 'true')) { - $noform = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "noform")); + if (!is_bool($noform)) { + if (($noform == '0') || ($noform == 'false')) { + $noform = false; + } elseif (($noform == '1') || ($noform == 'true')) { + $noform = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "noform")); + } } - 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")); + if (!is_bool($noheader)) { + 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")); + } } if (empty($args['page'])) Modified: trunk/lib/plugin/ListSubpages.php =================================================================== --- trunk/lib/plugin/ListSubpages.php 2021-09-14 14:07:14 UTC (rev 10553) +++ trunk/lib/plugin/ListSubpages.php 2021-09-14 16:59:19 UTC (rev 10554) @@ -87,12 +87,14 @@ } 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")); + if (!is_bool($noheader)) { + 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")); + } } $content = HTML(); Modified: trunk/lib/plugin/MostPopular.php =================================================================== --- trunk/lib/plugin/MostPopular.php 2021-09-14 14:07:14 UTC (rev 10553) +++ trunk/lib/plugin/MostPopular.php 2021-09-14 16:59:19 UTC (rev 10554) @@ -66,12 +66,14 @@ 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")); + if (!is_bool($noheader)) { + 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")); + } } if (isset($limit) && !is_limit($limit)) { Modified: trunk/lib/plugin/NewPagesPerUser.php =================================================================== --- trunk/lib/plugin/NewPagesPerUser.php 2021-09-14 14:07:14 UTC (rev 10553) +++ trunk/lib/plugin/NewPagesPerUser.php 2021-09-14 16:59:19 UTC (rev 10554) @@ -68,19 +68,24 @@ $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 (!is_bool($comments)) { + 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 (!is_bool($links)) { + 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) Modified: trunk/lib/plugin/OrphanedPages.php =================================================================== --- trunk/lib/plugin/OrphanedPages.php 2021-09-14 14:07:14 UTC (rev 10553) +++ trunk/lib/plugin/OrphanedPages.php 2021-09-14 16:59:19 UTC (rev 10554) @@ -72,20 +72,24 @@ 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")); + if (!is_bool($noheader)) { + 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")); + } } - if (($include_empty == '0') || ($include_empty == 'false')) { - $include_empty = false; - } elseif (($include_empty == '1') || ($include_empty == 'true')) { - $include_empty = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "include_empty")); + if (!is_bool($include_empty)) { + if (($include_empty == '0') || ($include_empty == 'false')) { + $include_empty = false; + } elseif (($include_empty == '1') || ($include_empty == 'true')) { + $include_empty = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "include_empty")); + } } // There's probably a more efficient way to do this (eg a Modified: trunk/lib/plugin/PopularNearby.php =================================================================== --- trunk/lib/plugin/PopularNearby.php 2021-09-14 14:07:14 UTC (rev 10553) +++ trunk/lib/plugin/PopularNearby.php 2021-09-14 16:59:19 UTC (rev 10554) @@ -74,12 +74,14 @@ 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")); + if (!is_bool($noheader)) { + 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 = ''; Modified: trunk/lib/plugin/RandomPage.php =================================================================== --- trunk/lib/plugin/RandomPage.php 2021-09-14 14:07:14 UTC (rev 10553) +++ trunk/lib/plugin/RandomPage.php 2021-09-14 16:59:19 UTC (rev 10554) @@ -63,20 +63,24 @@ $args = $this->getArgs($argstr, $request); extract($args); - if (($redirect == '0') || ($redirect == 'false')) { - $redirect = false; - } elseif (($redirect == '1') || ($redirect == 'true')) { - $redirect = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "redirect")); + if (!is_bool($redirect)) { + if (($redirect == '0') || ($redirect == 'false')) { + $redirect = false; + } elseif (($redirect == '1') || ($redirect == 'true')) { + $redirect = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "redirect")); + } } - if (($hidename == '0') || ($hidename == 'false')) { - $hidename = false; - } elseif (($hidename == '1') || ($hidename == 'true')) { - $hidename = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "hidename")); + if (!is_bool($hidename)) { + if (($hidename == '0') || ($hidename == 'false')) { + $hidename = false; + } elseif (($hidename == '1') || ($hidename == 'true')) { + $hidename = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "hidename")); + } } // Redirect would break HTML dump Modified: trunk/lib/plugin/RecentReferrers.php =================================================================== --- trunk/lib/plugin/RecentReferrers.php 2021-09-14 14:07:14 UTC (rev 10553) +++ trunk/lib/plugin/RecentReferrers.php 2021-09-14 16:59:19 UTC (rev 10554) @@ -63,12 +63,14 @@ $args = $this->getArgs($argstr, $request); $noheader = $args['noheader']; - 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")); + if (!is_bool($noheader)) { + 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")); + } } $table = HTML::table(array('class' => 'pagelist')); Modified: trunk/lib/plugin/RssFeed.php =================================================================== --- trunk/lib/plugin/RssFeed.php 2021-09-14 14:07:14 UTC (rev 10553) +++ trunk/lib/plugin/RssFeed.php 2021-09-14 16:59:19 UTC (rev 10554) @@ -63,12 +63,14 @@ { extract($this->getArgs($argstr, $request)); - if (($titleonly == '0') || ($titleonly == 'false')) { - $titleonly = false; - } elseif (($titleonly == '1') || ($titleonly == 'true')) { - $titleonly = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "titleonly")); + if (!is_bool($titleonly)) { + if (($titleonly == '0') || ($titleonly == 'false')) { + $titleonly = false; + } elseif (($titleonly == '1') || ($titleonly == 'true')) { + $titleonly = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "titleonly")); + } } $rss_parser = new RSSParser(); Modified: trunk/lib/plugin/SearchHighlight.php =================================================================== --- trunk/lib/plugin/SearchHighlight.php 2021-09-14 14:07:14 UTC (rev 10553) +++ trunk/lib/plugin/SearchHighlight.php 2021-09-14 16:59:19 UTC (rev 10554) @@ -72,12 +72,14 @@ } extract($args); - if (($case_exact == '0') || ($case_exact == 'false')) { - $case_exact = false; - } elseif (($case_exact == '1') || ($case_exact == 'true')) { - $case_exact = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "case_exact")); + if (!is_bool($case_exact)) { + if (($case_exact == '0') || ($case_exact == 'false')) { + $case_exact = false; + } elseif (($case_exact == '1') || ($case_exact == 'true')) { + $case_exact = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "case_exact")); + } } $html = HTML(); Modified: trunk/lib/plugin/SemanticRelations.php =================================================================== --- trunk/lib/plugin/SemanticRelations.php 2021-09-14 14:07:14 UTC (rev 10553) +++ trunk/lib/plugin/SemanticRelations.php 2021-09-14 16:59:19 UTC (rev 10554) @@ -64,20 +64,24 @@ $args = $this->getArgs($argstr, $request); 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")); + if (!is_bool($noheader)) { + 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")); + } } - if (($nohelp == '0') || ($nohelp == 'false')) { - $nohelp = false; - } elseif (($nohelp == '1') || ($nohelp == 'true')) { - $nohelp = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "nohelp")); + if (!is_bool($nohelp)) { + if (($nohelp == '0') || ($nohelp == 'false')) { + $nohelp = false; + } elseif (($nohelp == '1') || ($nohelp == 'true')) { + $nohelp = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "nohelp")); + } } if (empty($page)) Modified: trunk/lib/plugin/SemanticSearch.php =================================================================== --- trunk/lib/plugin/SemanticSearch.php 2021-09-14 14:07:14 UTC (rev 10553) +++ trunk/lib/plugin/SemanticSearch.php 2021-09-14 16:59:19 UTC (rev 10554) @@ -295,28 +295,34 @@ , fmt("See %s", WikiLink(_("Help").":"._("SemanticRelations"))))); extract($args); - if (($case_exact == '0') || ($case_exact == 'false')) { - $case_exact = false; - } elseif (($case_exact == '1') || ($case_exact == 'true')) { - $case_exact = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "case_exact")); + if (!is_bool($case_exact)) { + if (($case_exact == '0') || ($case_exact == 'false')) { + $case_exact = false; + } elseif (($case_exact == '1') || ($case_exact == 'true')) { + $case_exact = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "case_exact")); + } } - if (($noform == '0') || ($noform == 'false')) { - $noform = false; - } elseif (($noform == '1') || ($noform == 'true')) { - $noform = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "noform")); + if (!is_bool($noform)) { + if (($noform == '0') || ($noform == 'false')) { + $noform = false; + } elseif (($noform == '1') || ($noform == 'true')) { + $noform = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "noform")); + } } - 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")); + if (!is_bool($noheader)) { + 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")); + } } // for convenience and harmony we allow GET requests also. Modified: trunk/lib/plugin/SemanticSearchAdvanced.php =================================================================== --- trunk/lib/plugin/SemanticSearchAdvanced.php 2021-09-14 14:07:14 UTC (rev 10553) +++ trunk/lib/plugin/SemanticSearchAdvanced.php 2021-09-14 16:59:19 UTC (rev 10554) @@ -151,28 +151,34 @@ extract($args); - if (($case_exact == '0') || ($case_exact == 'false')) { - $case_exact = false; - } elseif (($case_exact == '1') || ($case_exact == 'true')) { - $case_exact = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "case_exact")); + if (!is_bool($case_exact)) { + if (($case_exact == '0') || ($case_exact == 'false')) { + $case_exact = false; + } elseif (($case_exact == '1') || ($case_exact == 'true')) { + $case_exact = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "case_exact")); + } } - if (($noform == '0') || ($noform == 'false')) { - $noform = false; - } elseif (($noform == '1') || ($noform == 'true')) { - $noform = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "noform")); + if (!is_bool($noform)) { + if (($noform == '0') || ($noform == 'false')) { + $noform = false; + } elseif (($noform == '1') || ($noform == 'true')) { + $noform = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "noform")); + } } - 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")); + if (!is_bool($noheader)) { + 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")); + } } // For convenience, peace and harmony we allow GET requests also. Modified: trunk/lib/plugin/TitleSearch.php =================================================================== --- trunk/lib/plugin/TitleSearch.php 2021-09-14 14:07:14 UTC (rev 10553) +++ trunk/lib/plugin/TitleSearch.php 2021-09-14 16:59:19 UTC (rev 10554) @@ -82,30 +82,36 @@ $args = $this->getArgs($argstr, $request); $auto_redirect = $args['auto_redirect']; - if (($auto_redirect == '0') || ($auto_redirect == 'false')) { - $auto_redirect = false; - } elseif (($auto_redirect == '1') || ($auto_redirect == 'true')) { - $auto_redirect = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "auto_redirect")); + if (!is_bool($auto_redirect)) { + if (($auto_redirect == '0') || ($auto_redirect == 'false')) { + $auto_redirect = false; + } elseif (($auto_redirect == '1') || ($auto_redirect == 'true')) { + $auto_redirect = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "auto_redirect")); + } } $noheader = $args['noheader']; - 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")); + if (!is_bool($noheader)) { + 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")); + } } $case_exact = $args['case_exact']; - if (($case_exact == '0') || ($case_exact == 'false')) { - $case_exact = false; - } elseif (($case_exact == '1') || ($case_exact == 'true')) { - $case_exact = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "case_exact")); + if (!is_bool($case_exact)) { + if (($case_exact == '0') || ($case_exact == 'false')) { + $case_exact = false; + } elseif (($case_exact == '1') || ($case_exact == 'true')) { + $case_exact = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "case_exact")); + } } if (isset($args['limit']) && !is_limit($args['limit'])) { Modified: trunk/lib/plugin/UserRatings.php =================================================================== --- trunk/lib/plugin/UserRatings.php 2021-09-14 14:07:14 UTC (rev 10553) +++ trunk/lib/plugin/UserRatings.php 2021-09-14 16:59:19 UTC (rev 10554) @@ -82,28 +82,34 @@ { extract($this->getArgs($argstr, $request)); - 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")); + if (!is_bool($noheader)) { + 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")); + } } - if (($userPage == '0') || ($userPage == 'false')) { - $userPage = false; - } elseif (($userPage == '1') || ($userPage == 'true')) { - $userPage = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "userPage")); + if (!is_bool($userPage)) { + if (($userPage == '0') || ($userPage == 'false')) { + $userPage = false; + } elseif (($userPage == '1') || ($userPage == 'true')) { + $userPage = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "userPage")); + } } - if (($nobuds == '0') || ($nobuds == 'false')) { - $nobuds = false; - } elseif (($nobuds == '1') || ($nobuds == 'true')) { - $nobuds = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "nobuds")); + if (!is_bool($nobuds)) { + if (($nobuds == '0') || ($nobuds == 'false')) { + $nobuds = false; + } elseif (($nobuds == '1') || ($nobuds == 'true')) { + $nobuds = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "nobuds")); + } } // XXX: fix to reflect multi-user ratings? Modified: trunk/lib/plugin/Video.php =================================================================== --- trunk/lib/plugin/Video.php 2021-09-14 14:07:14 UTC (rev 10553) +++ trunk/lib/plugin/Video.php 2021-09-14 16:59:19 UTC (rev 10554) @@ -80,12 +80,14 @@ $height = $args['height']; $autoplay = $args['autoplay']; - if (($autoplay == '0') || ($autoplay == 'false')) { - $autoplay = false; - } elseif (($autoplay == '1') || ($autoplay == 'true')) { - $autoplay = true; - } else { - return $this->error(sprintf(_("Argument '%s' must be a boolean"), "autoplay")); + if (!is_bool($autoplay)) { + if (($autoplay == '0') || ($autoplay == 'false')) { + $autoplay = false; + } elseif (($autoplay == '1') || ($autoplay == 'true')) { + $autoplay = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "autoplay")); + } } if (!$url && !$file) { Modified: trunk/lib/plugin/WantedPages.php =================================================================== --- trunk/lib/plugin/WantedPages.php 2021-09-14 14:07:14 UTC (rev 10553) +++ trunk/lib/plugin/WantedPages.php 2021-09-14 16:59:19 UTC (rev 10554) @@ -84,12 +84,14 @@ 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")); + if (!is_bool($noheader)) { + 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")); + } } if ($page == _("WantedPages")) $page = ""; Modified: trunk/lib/plugin/WikiForum.php =================================================================== --- trunk/lib/plugin/WikiForum.php 2021-09-14 14:07:14 UTC (rev 10553) +++ trunk/lib/plugin/WikiForum.php 2021-09-14 16:59:19 UTC (rev 10554) @@ -81,12 +81,14 @@ } $noheader = $args['noheader']; - 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")); + if (!is_bool($noheader)) { + 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")); + } } // Get our form args. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-09-14 14:07:16
|
Revision: 10553 http://sourceforge.net/p/phpwiki/code/10553 Author: vargenau Date: 2021-09-14 14:07:14 +0000 (Tue, 14 Sep 2021) Log Message: ----------- lib/plugin/NewPagesPerUser.php: add random number in id so that multiple calls of plugin are allowed in same page Modified Paths: -------------- trunk/lib/plugin/NewPagesPerUser.php Modified: trunk/lib/plugin/NewPagesPerUser.php =================================================================== --- trunk/lib/plugin/NewPagesPerUser.php 2021-09-14 10:37:51 UTC (rev 10552) +++ trunk/lib/plugin/NewPagesPerUser.php 2021-09-14 14:07:14 UTC (rev 10553) @@ -126,7 +126,7 @@ uasort($parr['author'], array($this, 'cmp_by_count')); foreach ($parr['author'] as $user => $authorarr) { $count = $authorarr['count']; - $id = preg_replace("/ /", "_", 'pages-' . $monthname . '-' . $user); + $id = preg_replace("/ /", "_", 'pages-' . $monthname . '-' . $user . '-' . rand()); $html->pushContent (HTML::tr(HTML::td($nbsp, $nbsp, HTML::img(array('id' => "$id-img", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-09-14 10:37:53
|
Revision: 10552 http://sourceforge.net/p/phpwiki/code/10552 Author: vargenau Date: 2021-09-14 10:37:51 +0000 (Tue, 14 Sep 2021) Log Message: ----------- http://bh.hallikainen.org is now using 1.6.0; remove http://wikiworld.com/wiki/ Modified Paths: -------------- trunk/pgsrc/Help%2FWikisUsingPhpWiki Modified: trunk/pgsrc/Help%2FWikisUsingPhpWiki =================================================================== --- trunk/pgsrc/Help%2FWikisUsingPhpWiki 2021-09-10 16:05:12 UTC (rev 10551) +++ trunk/pgsrc/Help%2FWikisUsingPhpWiki 2021-09-14 10:37:51 UTC (rev 10552) @@ -1,4 +1,4 @@ -Date: Sat, 14 Aug 2021 13:48:37 +0000 +Date: Tue, 14 Sep 2021 12:20:51 +0000 Mime-Version: 1.0 (Produced by PhpWiki 1.6.0) Content-Type: application/x-phpwiki; pagename=Help%2FWikisUsingPhpWiki @@ -10,7 +10,7 @@ |= URL |= ~PhpWiki release |= Theme | http://alsach.at/phpwiki/ | 1.4.0RC1 | default -| http://bh.hallikainen.org | 1.5.5 | Sidebar +| http://bh.hallikainen.org | 1.6.0 | Sidebar | http://www.carnatic.com/karmasaya/ | http://churchofvirus.org/wiki/ | 1.3.2-jeffs-hacks | Virus (custom) | http://crossfamily.me.uk/wiki/ | 1.2.7 @@ -53,7 +53,6 @@ | https://wiki.cyberleo.net | 1.5.5 | MacOSX | http://wiki.elaboratedsolutions.com | http://wiki.wlug.org.nz | 1.3.11p1 | WLUG05 (custom) -| http://wikiworld.com/wiki/ | | ~MonoBook | http://www.allpsych.uni-giessen.de/wikidump/HomePage.html | ?? (wikidump) | http://www-bd.lip6.fr/ens/li345-2011/index.php/Accueil | 1.4.0RC1 | default | https://www.cs.helsinki.fi/group/keltsi/wikidumphtml/HomePage | ?? (wikidump) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-09-10 16:05:13
|
Revision: 10551 http://sourceforge.net/p/phpwiki/code/10551 Author: vargenau Date: 2021-09-10 16:05:12 +0000 (Fri, 10 Sep 2021) Log Message: ----------- lib/plugin/AuthorHistory.php: display error message when user not signed in and no author is specified. Modified Paths: -------------- trunk/lib/plugin/AuthorHistory.php Modified: trunk/lib/plugin/AuthorHistory.php =================================================================== --- trunk/lib/plugin/AuthorHistory.php 2021-09-10 13:14:12 UTC (rev 10550) +++ trunk/lib/plugin/AuthorHistory.php 2021-09-10 16:05:12 UTC (rev 10551) @@ -114,11 +114,11 @@ return $this->error(sprintf(_("Argument '%s' must be a boolean"), "includedeleted")); } + if (!$author) { // user not signed in and no author specified + return HTML::p(array('class' => 'error'), _("You are not signed in and no author is specified.")); + } if ($page && $page == 'username') //FIXME: use [username]!!!!! $page = $author; - if (!$page || !$author) //user not signed in or no author specified - return ''; - //$pagelist = new PageList($info, $exclude); $nbsp = HTML::raw(' '); @@ -162,16 +162,16 @@ $class = $isminor ? 'evenrow' : 'oddrow'; $tr->setAttr('class', $class); $tbody->pushContent($tr); - //$pagelist->addPage($rev->getPage()); } } - $captext = fmt($includeminor ? "History of all major and minor edits by %s to page %s." : "History of all major edits by %s to page %s.", - WikiLink($author, 'auto'), - WikiLink($page, 'auto')); + $captext = fmt($includeminor + ? "History of all major and minor edits by %s to page %s." + : "History of all major edits by %s to page %s.", + WikiLink($author, 'auto'), + WikiLink($page, 'auto')); } else { //search all pages for all edits by this author - $thead->pushContent(HTML::tr(HTML::th(_("Page Name")), HTML::th(array('class' => 'align-right'), _("Version")), @@ -206,38 +206,19 @@ $class = $isminor ? 'evenrow' : 'oddrow'; $tr->setAttr('class', $class); $tbody->pushContent($tr); - //$pagelist->addPage($rev->getPage()); } } } - $captext = fmt($includeminor ? "History of all major and minor modifications for any page edited by %s." : "History of major modifications for any page edited by %s.", - WikiLink($author, 'auto')); + $captext = fmt($includeminor + ? "History of all major and minor modifications for any page edited by %s." + : "History of major modifications for any page edited by %s.", + WikiLink($author, 'auto')); } $table->pushContent(HTML::caption($captext)); $table->pushContent($thead, $tbody); - // if (!$noheader) { - // total minor, major edits. if include minoredits was specified - // } return $table; - - // if (!$noheader) { - // $pagelink = WikiLink($page, 'auto'); - // - // if ($pagelist->isEmpty()) - // return HTML::p(fmt("No pages link to %s.", $pagelink)); - // - // if ($pagelist->getTotal() == 1) - // $pagelist->setCaption(fmt("One page links to %s:", - // $pagelink)); - // else - // $pagelist->setCaption(fmt("%s pages link to %s:", - // $pagelist->getTotal(), $pagelink)); - // } - // - // return $pagelist; } - } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |