From: <var...@us...> - 2021-02-22 18:28:37
|
Revision: 10256 http://sourceforge.net/p/phpwiki/code/10256 Author: vargenau Date: 2021-02-22 18:28:34 +0000 (Mon, 22 Feb 2021) Log Message: ----------- include_self and noheader are false Modified Paths: -------------- trunk/lib/plugin/IncludeSiteMap.php trunk/lib/plugin/IncludeTree.php trunk/lib/plugin/SiteMap.php Modified: trunk/lib/plugin/IncludeSiteMap.php =================================================================== --- trunk/lib/plugin/IncludeSiteMap.php 2021-02-22 18:20:51 UTC (rev 10255) +++ trunk/lib/plugin/IncludeSiteMap.php 2021-02-22 18:28:34 UTC (rev 10256) @@ -58,8 +58,8 @@ function getDefaultArguments() { return array('exclude' => '', - 'include_self' => 0, - 'noheader' => 0, + 'include_self' => false, + 'noheader' => false, 'page' => '[pagename]', 'description' => $this->getDescription(), 'reclimit' => 2, Modified: trunk/lib/plugin/IncludeTree.php =================================================================== --- trunk/lib/plugin/IncludeTree.php 2021-02-22 18:20:51 UTC (rev 10255) +++ trunk/lib/plugin/IncludeTree.php 2021-02-22 18:28:34 UTC (rev 10256) @@ -45,8 +45,8 @@ function getDefaultArguments() { return array('exclude' => '', - 'include_self' => 0, - 'noheader' => 0, + 'include_self' => false, + 'noheader' => false, 'page' => '[pagename]', 'description' => $this->getDescription(), 'reclimit' => 2, Modified: trunk/lib/plugin/SiteMap.php =================================================================== --- trunk/lib/plugin/SiteMap.php 2021-02-22 18:20:51 UTC (rev 10255) +++ trunk/lib/plugin/SiteMap.php 2021-02-22 18:28:34 UTC (rev 10256) @@ -63,8 +63,8 @@ function getDefaultArguments() { return array('exclude' => '', - 'include_self' => 0, - 'noheader' => 0, + 'include_self' => false, + 'noheader' => false, 'page' => '[pagename]', 'description' => $this->getDescription(), 'reclimit' => 4, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-06-17 14:34:08
|
Revision: 10294 http://sourceforge.net/p/phpwiki/code/10294 Author: vargenau Date: 2021-06-17 14:34:02 +0000 (Thu, 17 Jun 2021) Log Message: ----------- Unneccessary return Modified Paths: -------------- trunk/lib/plugin/CurrentTime.php trunk/lib/plugin/IncludePage.php trunk/lib/plugin/OldStyleTable.php trunk/lib/plugin/RecentComments.php trunk/lib/plugin/RssFeed.php trunk/lib/plugin/UpLoad.php trunk/lib/plugin/WikiFormRich.php trunk/lib/plugin/WikicreoleTable.php Modified: trunk/lib/plugin/CurrentTime.php =================================================================== --- trunk/lib/plugin/CurrentTime.php 2021-06-17 14:31:12 UTC (rev 10293) +++ trunk/lib/plugin/CurrentTime.php 2021-06-17 14:34:02 UTC (rev 10294) @@ -68,7 +68,6 @@ function handle_plugin_args_cruft($argstr, $args) { - return; } /** Modified: trunk/lib/plugin/IncludePage.php =================================================================== --- trunk/lib/plugin/IncludePage.php 2021-06-17 14:31:12 UTC (rev 10293) +++ trunk/lib/plugin/IncludePage.php 2021-06-17 14:34:02 UTC (rev 10294) @@ -71,7 +71,6 @@ // <<IncludePages pages=<!plugin-list BackLinks page=CategoryWikiPlugin !> >> function handle_plugin_args_cruft($argstr, $args) { - return; } /** Modified: trunk/lib/plugin/OldStyleTable.php =================================================================== --- trunk/lib/plugin/OldStyleTable.php 2021-06-17 14:31:12 UTC (rev 10293) +++ trunk/lib/plugin/OldStyleTable.php 2021-06-17 14:34:02 UTC (rev 10294) @@ -65,7 +65,6 @@ function handle_plugin_args_cruft($argstr, $args) { - return; } /** Modified: trunk/lib/plugin/RecentComments.php =================================================================== --- trunk/lib/plugin/RecentComments.php 2021-06-17 14:31:12 UTC (rev 10293) +++ trunk/lib/plugin/RecentComments.php 2021-06-17 14:34:02 UTC (rev 10294) @@ -96,7 +96,6 @@ function title() { - return; } function format_revision($rev) Modified: trunk/lib/plugin/RssFeed.php =================================================================== --- trunk/lib/plugin/RssFeed.php 2021-06-17 14:31:12 UTC (rev 10293) +++ trunk/lib/plugin/RssFeed.php 2021-06-17 14:34:02 UTC (rev 10294) @@ -50,7 +50,6 @@ function handle_plugin_args_cruft($argstr, $args) { - return; } /** Modified: trunk/lib/plugin/UpLoad.php =================================================================== --- trunk/lib/plugin/UpLoad.php 2021-06-17 14:31:12 UTC (rev 10293) +++ trunk/lib/plugin/UpLoad.php 2021-06-17 14:34:02 UTC (rev 10294) @@ -278,6 +278,5 @@ . "<td> <em>" . $user->getId() . "</em></td></tr>"); fclose($log_handle); } - return; } } Modified: trunk/lib/plugin/WikiFormRich.php =================================================================== --- trunk/lib/plugin/WikiFormRich.php 2021-06-17 14:31:12 UTC (rev 10293) +++ trunk/lib/plugin/WikiFormRich.php 2021-06-17 14:34:02 UTC (rev 10294) @@ -172,7 +172,6 @@ E_USER_WARNING); } } - return; } /** Modified: trunk/lib/plugin/WikicreoleTable.php =================================================================== --- trunk/lib/plugin/WikicreoleTable.php 2021-06-17 14:31:12 UTC (rev 10293) +++ trunk/lib/plugin/WikicreoleTable.php 2021-06-17 14:34:02 UTC (rev 10294) @@ -65,7 +65,6 @@ function handle_plugin_args_cruft($argstr, $args) { - return; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-06-17 15:44:39
|
Revision: 10295 http://sourceforge.net/p/phpwiki/code/10295 Author: vargenau Date: 2021-06-17 15:44:38 +0000 (Thu, 17 Jun 2021) Log Message: ----------- Use same parameter name in subclasses Modified Paths: -------------- trunk/lib/plugin/BackLinks.php trunk/lib/plugin/FullTextSearch.php trunk/lib/plugin/LinkDatabase.php trunk/lib/plugin/LinkSearch.php trunk/lib/plugin/ListPages.php trunk/lib/plugin/ListSubpages.php trunk/lib/plugin/SemanticSearch.php trunk/lib/plugin/WantedPages.php trunk/lib/plugin/WikiAdminUtils.php trunk/lib/plugin/WikiTranslation.php Modified: trunk/lib/plugin/BackLinks.php =================================================================== --- trunk/lib/plugin/BackLinks.php 2021-06-17 14:34:02 UTC (rev 10294) +++ trunk/lib/plugin/BackLinks.php 2021-06-17 15:44:38 UTC (rev 10295) @@ -211,9 +211,9 @@ // how many links from this backLink to other pages class _PageList_Column_BackLinks_count extends _PageList_Column { - function _getValue($page, $revision_handle) + function _getValue($page_handle, $revision_handle) { - $iter = $page->getPageLinks(); + $iter = $page_handle->getPageLinks(); $count = $iter->count(); return $count; } Modified: trunk/lib/plugin/FullTextSearch.php =================================================================== --- trunk/lib/plugin/FullTextSearch.php 2021-06-17 14:34:02 UTC (rev 10294) +++ trunk/lib/plugin/FullTextSearch.php 2021-06-17 15:44:38 UTC (rev 10295) @@ -205,11 +205,11 @@ parent::__construct($params[0], $params[1], $params[2]); } - function _getValue($page, $revision_handle) + function _getValue($page_handle, $revision_handle) { - $pagename = $page->getName(); + $pagename = $page_handle->getName(); $count = count($this->parentobj->_wpagelist[$pagename]); - return LinkURL(WikiURL($page, array('action' => 'BackLinks'), false), + return LinkURL(WikiURL($page_handle, array('action' => 'BackLinks'), false), fmt("(%d Links)", $count)); } } Modified: trunk/lib/plugin/LinkDatabase.php =================================================================== --- trunk/lib/plugin/LinkDatabase.php 2021-06-17 14:34:02 UTC (rev 10294) +++ trunk/lib/plugin/LinkDatabase.php 2021-06-17 15:44:38 UTC (rev 10295) @@ -224,10 +224,10 @@ class _PageList_Column_LinkDatabase_links extends _PageList_Column { - function _getValue($page, $revision_handle) + function _getValue($page_handle, $revision_handle) { $out = HTML(); - $links = $page->getPageLinks(); + $links = $page_handle->getPageLinks(); while ($link = $links->next()) { $out->pushContent(" ", WikiLink($link)); } Modified: trunk/lib/plugin/LinkSearch.php =================================================================== --- trunk/lib/plugin/LinkSearch.php 2021-06-17 14:34:02 UTC (rev 10294) +++ trunk/lib/plugin/LinkSearch.php 2021-06-17 15:44:38 UTC (rev 10295) @@ -198,10 +198,12 @@ $this->_pagelist =& $pagelist; } - function _getValue($page, $revision_handle) + function _getValue($page_handle, $revision_handle) { - if (is_object($page)) $text = $page->getName(); - else $text = $page; + if (is_object($page_handle)) + $text = $page_handle->getName(); + else + $text = $page_handle; $link = $this->_pagelist->_links[$this->current_row]; return WikiLink($link['linkvalue'], 'if_known'); } Modified: trunk/lib/plugin/ListPages.php =================================================================== --- trunk/lib/plugin/ListPages.php 2021-06-17 14:34:02 UTC (rev 10294) +++ trunk/lib/plugin/ListPages.php 2021-06-17 15:44:38 UTC (rev 10295) @@ -146,9 +146,9 @@ parent::__construct($field, $display, 'center'); } - function _getValue($page, $revision_handle) + function _getValue($page_handle, $revision_handle) { - $iter = $page->getLinks($this->_direction); + $iter = $page_handle->getLinks($this->_direction); $count = $iter->count(); return $count; } Modified: trunk/lib/plugin/ListSubpages.php =================================================================== --- trunk/lib/plugin/ListSubpages.php 2021-06-17 14:34:02 UTC (rev 10294) +++ trunk/lib/plugin/ListSubpages.php 2021-06-17 15:44:38 UTC (rev 10295) @@ -136,9 +136,9 @@ // how many backlinks for this subpage class _PageList_Column_ListSubpages_count extends _PageList_Column { - function _getValue($page, $revision_handle) + function _getValue($page_handle, $revision_handle) { - $iter = $page->getBackLinks(); + $iter = $page_handle->getBackLinks(); $count = $iter->count(); return $count; } Modified: trunk/lib/plugin/SemanticSearch.php =================================================================== --- trunk/lib/plugin/SemanticSearch.php 2021-06-17 14:34:02 UTC (rev 10294) +++ trunk/lib/plugin/SemanticSearch.php 2021-06-17 15:44:38 UTC (rev 10295) @@ -472,7 +472,7 @@ $this->_pagelist =& $pagelist; } - function _getValue($page, $revision_handle) + function _getValue($page_handle, $revision_handle) { $link = $this->_pagelist->_links[$this->current_row]; return WikiLink($link['linkname'], 'if_known'); @@ -482,7 +482,7 @@ class _PageList_Column_SemanticSearch_link extends _PageList_Column_SemanticSearch_relation { - function _getValue($page, $revision_handle) + function _getValue($page_handle, $revision_handle) { $link = $this->_pagelist->_links[$this->current_row]; if ($this->_field != 'value') Modified: trunk/lib/plugin/WantedPages.php =================================================================== --- trunk/lib/plugin/WantedPages.php 2021-06-17 14:34:02 UTC (rev 10294) +++ trunk/lib/plugin/WantedPages.php 2021-06-17 15:44:38 UTC (rev 10295) @@ -176,10 +176,10 @@ parent::__construct($params[0], $params[1], $params[2]); } - function _getValue($page, $revision_handle) + function _getValue($page_handle, $revision_handle) { $html = false; - $pagename = $page->getName(); + $pagename = $page_handle->getName(); foreach ($this->parentobj->_wpagelist[$pagename] as $page) { if ($html) $html->pushContent(', ', WikiLink($page)); @@ -201,9 +201,9 @@ parent::__construct($params[0], $params[1], $params[2]); } - function _getValue($page, $revision_handle) + function _getValue($page_handle, $revision_handle) { - $pagename = $page->getName(); + $pagename = $page_handle->getName(); $count = count($this->parentobj->_wpagelist[$pagename]); return LinkURL(WikiURL($page, array('action' => 'BackLinks'), false), fmt("(%d Links)", $count)); Modified: trunk/lib/plugin/WikiAdminUtils.php =================================================================== --- trunk/lib/plugin/WikiAdminUtils.php 2021-06-17 14:34:02 UTC (rev 10294) +++ trunk/lib/plugin/WikiAdminUtils.php 2021-06-17 15:44:38 UTC (rev 10295) @@ -315,9 +315,9 @@ class _PageList_Column_email extends _PageList_Column { - function _getValue($prefs, $dummy) + function _getValue($page_handle, $revision_handle) { - return $prefs->get('email'); + return $page_handle->get('email'); } } @@ -324,15 +324,15 @@ class _PageList_Column_emailVerified extends _PageList_Column { - function _getValue($prefs, $status) + function _getValue($page_handle, $revision_handle) { - $name = $prefs->get('userid'); + $name = $page_handle->get('userid'); $input = HTML::input(array('type' => 'checkbox', 'name' => 'wikiadminutils[verified][' . $name . ']', 'value' => 1)); - if ($prefs->get('emailVerified')) + if ($page_handle->get('emailVerified')) $input->setAttr('checked', '1'); - if ($status) + if ($revision_handle) $input->setAttr('disabled', '1'); return HTML($input, HTML::input (array('type' => 'hidden', Modified: trunk/lib/plugin/WikiTranslation.php =================================================================== --- trunk/lib/plugin/WikiTranslation.php 2021-06-17 14:34:02 UTC (rev 10294) +++ trunk/lib/plugin/WikiTranslation.php 2021-06-17 15:44:38 UTC (rev 10295) @@ -516,10 +516,12 @@ _PageList_Column_base::__construct($this->_field); } - function _getValue($page, $revision_handle) + function _getValue($page_handle, $revision_handle) { - if (is_object($page)) $text = $page->getName(); - else $text = $page; + if (is_object($page_handle)) + $text = $page_handle->getName(); + else + $text = $page_handle; $trans = $this->_plugin->fast_translate($text, $this->_field, $this->_from_lang); // how to markup untranslated words and not existing pages? @@ -547,10 +549,10 @@ $text->setAttr('style', 'text-decoration:line-through'); $link->pushContent($text); return $link; - } elseif (is_object($page)) + } elseif (is_object($page_handle)) return ''; else // not existing: empty return ''; - } elseif (is_object($page)) { + } elseif (is_object($page_handle)) { if (!$this->_nolinks) return WikiLink($trans, 'auto'); else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-06-17 16:04:20
|
Revision: 10296 http://sourceforge.net/p/phpwiki/code/10296 Author: vargenau Date: 2021-06-17 16:04:14 +0000 (Thu, 17 Jun 2021) Log Message: ----------- Use same parameter name in subclasses Modified Paths: -------------- trunk/lib/plugin/GraphViz.php trunk/lib/plugin/Ploticus.php trunk/lib/plugin/RecentChangesCached.php trunk/lib/plugin/VisualWiki.php Modified: trunk/lib/plugin/GraphViz.php =================================================================== --- trunk/lib/plugin/GraphViz.php 2021-06-17 15:44:38 UTC (rev 10295) +++ trunk/lib/plugin/GraphViz.php 2021-06-17 16:04:14 UTC (rev 10296) @@ -166,7 +166,7 @@ * This gives an alternative text description of * the image. */ - function getAlt($dbi, $argstr, $request) + function getAlt($dbi, $argarray, $request) { return (!empty($this->_args['alt'])) ? $this->_args['alt'] : $this->getDescription(); Modified: trunk/lib/plugin/Ploticus.php =================================================================== --- trunk/lib/plugin/Ploticus.php 2021-06-17 15:44:38 UTC (rev 10295) +++ trunk/lib/plugin/Ploticus.php 2021-06-17 16:04:14 UTC (rev 10296) @@ -161,7 +161,7 @@ * This gives an alternative text description of * the image. */ - function getAlt($dbi, $argstr, $request) + function getAlt($dbi, $argarray, $request) { return (!empty($this->_args['alt'])) ? $this->_args['alt'] : $this->getDescription(); Modified: trunk/lib/plugin/RecentChangesCached.php =================================================================== --- trunk/lib/plugin/RecentChangesCached.php 2021-06-17 15:44:38 UTC (rev 10295) +++ trunk/lib/plugin/RecentChangesCached.php 2021-06-17 16:04:14 UTC (rev 10296) @@ -67,16 +67,16 @@ * better plugin methods. * * @param WikiDB $dbi - * @param string $args + * @param string $argarray * @param WikiRequest $request * @param string $basepage * @return mixed */ - protected function getHtml($dbi, $args, $request, $basepage) + protected function getHtml($dbi, $argarray, $request, $basepage) { $plugin = new WikiPlugin_RecentChanges(); - $changes = $plugin->getChanges($dbi, $args); - return $plugin->format($changes, $args); + $changes = $plugin->getChanges($dbi, $argarray); + return $plugin->format($changes, $argarray); /* $loader = new WikiPluginLoader(); return $loader->expandPI('<?plugin RecentChanges ' Modified: trunk/lib/plugin/VisualWiki.php =================================================================== --- trunk/lib/plugin/VisualWiki.php 2021-06-17 15:44:38 UTC (rev 10295) +++ trunk/lib/plugin/VisualWiki.php 2021-06-17 16:04:14 UTC (rev 10296) @@ -407,9 +407,8 @@ * Creates the text file description of the graph needed to invoke * <code>dot</code>. * - * @param string $filename + * @param string $tempfile * @param array $argarray - * @internal param string $filename name of the dot file to be created * @internal param float $width width of the output graph in inches * @internal param float $height height of the graph in inches * @internal param string $colorby color sceme beeing used ('age', 'revtime', @@ -419,10 +418,10 @@ * 'number': label by unique number * @return bool error status; true=ok; false=error */ - function createDotFile($filename = '', $argarray = array()) + function createDotFile($tempfile = '', $argarray = array()) { extract($argarray); - if (!$fp = fopen($filename, 'w')) + if (!$fp = fopen($tempfile, 'w')) return false; $fillstring = ($fillnodes == 'on') ? 'style=filled,' : ''; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-06-17 16:40:03
|
Revision: 10299 http://sourceforge.net/p/phpwiki/code/10299 Author: vargenau Date: 2021-06-17 16:39:59 +0000 (Thu, 17 Jun 2021) Log Message: ----------- trigger_error has E_USER_NOTICE as default; mkdir has 0777 as default Modified Paths: -------------- trunk/lib/plugin/PhotoAlbum.php trunk/lib/plugin/PhpHighlight.php trunk/lib/plugin/PhpWeather.php trunk/lib/plugin/TeX2png.php trunk/lib/plugin/WikiPoll.php trunk/lib/plugin/text2png.php Modified: trunk/lib/plugin/PhotoAlbum.php =================================================================== --- trunk/lib/plugin/PhotoAlbum.php 2021-06-17 16:28:47 UTC (rev 10298) +++ trunk/lib/plugin/PhotoAlbum.php 2021-06-17 16:39:59 UTC (rev 10299) @@ -289,8 +289,7 @@ if (!$size and !empty($value["src"])) { $size = @getimagesize($value["src"]); if (!$size) { - trigger_error("Unable to getimagesize(" . $value["name"] . ")", - E_USER_NOTICE); + trigger_error("Unable to getimagesize(" . $value["name"] . ")"); } } $newwidth = $this->newSize($size[0], $width); Modified: trunk/lib/plugin/PhpHighlight.php =================================================================== --- trunk/lib/plugin/PhpHighlight.php 2021-06-17 16:28:47 UTC (rev 10298) +++ trunk/lib/plugin/PhpHighlight.php 2021-06-17 16:39:59 UTC (rev 10299) @@ -130,8 +130,7 @@ } elseif (($length < $MAXLEN + 1) && in_array($color, $html4colors)) { // stop checking, ok to go } else { - trigger_error(sprintf(_("Invalid color: %s"), - $color), E_USER_NOTICE); + trigger_error(sprintf(_("Invalid color: %s"), $color)); // FIXME: also change color to something valid like "black" or ini_get("highlight.xxx") } } Modified: trunk/lib/plugin/PhpWeather.php =================================================================== --- trunk/lib/plugin/PhpWeather.php 2021-06-17 16:28:47 UTC (rev 10298) +++ trunk/lib/plugin/PhpWeather.php 2021-06-17 16:39:59 UTC (rev 10299) @@ -85,8 +85,7 @@ if (!$w->get_country_code()) { /* The country code couldn't be resolved, so we * shouldn't use the ICAO: */ - trigger_error(sprintf(_("The ICAO “%s” wasn't recognized."), - $icao), E_USER_NOTICE); + trigger_error(sprintf(_("The ICAO “%s” wasn't recognized."), $icao)); $icao = ''; } } @@ -97,8 +96,7 @@ //if (!in_array($language, array_keys($w->get_languages('text')))) { if (!in_array($language, array_keys(get_languages('text')))) { trigger_error(sprintf(_("%s does not know about the language “%s”, using “en” instead."), - $this->getName(), $language), - E_USER_NOTICE); + $this->getName(), $language)); $language = 'en'; } Modified: trunk/lib/plugin/TeX2png.php =================================================================== --- trunk/lib/plugin/TeX2png.php 2021-06-17 16:28:47 UTC (rev 10298) +++ trunk/lib/plugin/TeX2png.php 2021-06-17 16:39:59 UTC (rev 10299) @@ -232,7 +232,7 @@ $error_html = _("Sorry, this version of PHP cannot create PNG image files."); $link = "http://www.php.net/manual/pl/ref.image.php"; $error_html .= sprintf(_("See %s"), $link) . "."; - trigger_error($error_html, E_USER_NOTICE); + trigger_error($error_html); return HTML::p($error_html); } } Modified: trunk/lib/plugin/WikiPoll.php =================================================================== --- trunk/lib/plugin/WikiPoll.php 2021-06-17 16:28:47 UTC (rev 10298) +++ trunk/lib/plugin/WikiPoll.php 2021-06-17 16:39:59 UTC (rev 10299) @@ -93,8 +93,7 @@ foreach (array_merge($argstr_args, $argstr_defaults) as $arg => $val) { if (!preg_match("/^(answer_|question_)/", $arg)) - trigger_error(sprintf(_("Argument “%s” not declared by plugin."), - $arg), E_USER_NOTICE); + trigger_error(sprintf(_("Argument “%s” not declared by plugin."), $arg)); } return $args; Modified: trunk/lib/plugin/text2png.php =================================================================== --- trunk/lib/plugin/text2png.php 2021-06-17 16:28:47 UTC (rev 10298) +++ trunk/lib/plugin/text2png.php 2021-06-17 16:39:59 UTC (rev 10299) @@ -87,7 +87,7 @@ $error_html = _("Sorry, this version of PHP cannot create PNG image files."); $link = "http://www.php.net/manual/pl/ref.image.php"; $error_html .= sprintf(_("See %s"), $link) . "."; - trigger_error($error_html, E_USER_NOTICE); + trigger_error($error_html); return HTML::p($error_html); } } @@ -137,8 +137,8 @@ if (!file_exists($filepath)) { $oldumask = umask(0); // permissions affected by user the www server is running as - mkdir(getUploadFilePath() . $basedir, 0777); - mkdir($filepath, 0777); + mkdir(getUploadFilePath() . $basedir); + mkdir($filepath); umask($oldumask); } $filepath .= "/"; @@ -174,7 +174,7 @@ // through it. $link = "http://www.php.net/manual/en/function.imagecreate.php"; $error_html .= sprintf(_("See %s"), $link) . "."; - trigger_error($error_html, E_USER_NOTICE); + trigger_error($error_html); return HTML::p($error_html); } $rgb = $this->hexcolor($backcolor, array(255, 255, 255)); @@ -215,12 +215,10 @@ switch ($success) { case 1: trigger_error(sprintf(_("Image saved to cache file: %s"), - $filepath . $filename), - E_USER_NOTICE); + $filepath . $filename)); case 2: trigger_error(sprintf(_("Image loaded from cache file: %s"), - $filepath . $filename), - E_USER_NOTICE); + $filepath . $filename)); } } $url = getUploadDataPath() . "$basedir/" . urlencode($l) . "/" . urlencode($filename); @@ -229,7 +227,7 @@ 'title' => '"' . $text . '"' . _(" produced by ") . $this->getName()))); } else { trigger_error(sprintf(_("couldn't open file “%s” for writing"), - $filepath . $filename), E_USER_NOTICE); + $filepath . $filename)); } return $html; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-06-17 17:17:38
|
Revision: 10301 http://sourceforge.net/p/phpwiki/code/10301 Author: vargenau Date: 2021-06-17 17:17:35 +0000 (Thu, 17 Jun 2021) Log Message: ----------- wikiblog is the default value Modified Paths: -------------- trunk/lib/plugin/BlogArchives.php trunk/lib/plugin/BlogJournal.php trunk/lib/plugin/WikiBlog.php Modified: trunk/lib/plugin/BlogArchives.php =================================================================== --- trunk/lib/plugin/BlogArchives.php 2021-06-17 17:09:18 UTC (rev 10300) +++ trunk/lib/plugin/BlogArchives.php 2021-06-17 17:17:35 UTC (rev 10301) @@ -93,7 +93,7 @@ // unset($pagelist->_columns['pagename']); if (!empty($args['month'])) { - $prefix = $parent . $this->blogPrefix('wikiblog') . '/' . $args['month']; + $prefix = $parent . $this->blogPrefix() . '/' . $args['month']; $pages = $dbi->titleSearch(new TextSearchQuery("^" . $prefix, true, 'posix')); $html = HTML::ul(); while ($page = $pages->next()) { @@ -109,7 +109,7 @@ return $html; } - $blogs = $this->findBlogs($dbi, $args['user'], 'wikiblog'); + $blogs = $this->findBlogs($dbi, $args['user']); if ($blogs) { if (!$basepage) $basepage = _("BlogArchives"); $html = HTML::ul(); Modified: trunk/lib/plugin/BlogJournal.php =================================================================== --- trunk/lib/plugin/BlogJournal.php 2021-06-17 17:09:18 UTC (rev 10300) +++ trunk/lib/plugin/BlogJournal.php 2021-06-17 17:17:35 UTC (rev 10301) @@ -84,7 +84,7 @@ } $parent = (empty($args['user']) ? '' : $args['user'] . '/'); - $prefix = $base = $parent . $this->blogPrefix('wikiblog'); + $prefix = $base = $parent . $this->blogPrefix(); if ($args['month']) $prefix .= ('/' . $args['month']); $pages = $dbi->titleSearch(new TextSearchQuery("^" . $prefix . '/', true, 'posix')); Modified: trunk/lib/plugin/WikiBlog.php =================================================================== --- trunk/lib/plugin/WikiBlog.php 2021-06-17 17:09:18 UTC (rev 10300) +++ trunk/lib/plugin/WikiBlog.php 2021-06-17 17:17:35 UTC (rev 10301) @@ -104,7 +104,7 @@ $request->setArg("edit", false); if ($request->isPost() and !empty($blog['save'])) { - $this->add($request, $blog, 'wikiblog'); // noreturn + $this->add($request, $blog); // noreturn } //TODO: preview This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-06-17 17:24:15
|
Revision: 10302 http://sourceforge.net/p/phpwiki/code/10302 Author: vargenau Date: 2021-06-17 17:24:11 +0000 (Thu, 17 Jun 2021) Log Message: ----------- function Button has default false Modified Paths: -------------- trunk/lib/plugin/EditMetaData.php trunk/lib/plugin/GoTo.php trunk/lib/plugin/LinkSearch.php trunk/lib/plugin/SemanticSearch.php trunk/lib/plugin/SemanticSearchAdvanced.php Modified: trunk/lib/plugin/EditMetaData.php =================================================================== --- trunk/lib/plugin/EditMetaData.php 2021-06-17 17:17:35 UTC (rev 10301) +++ trunk/lib/plugin/EditMetaData.php 2021-06-17 17:24:11 UTC (rev 10302) @@ -143,7 +143,7 @@ $instructions = _("Add or change a page-level metadata 'key=>value' pair. Note that you can remove a key by leaving the value-box empty."); $keyfield = HTML::input(array('name' => 'metafield'), ''); $valfield = HTML::input(array('name' => 'metavalue'), ''); - $button = Button('submit:metaedit', _("Submit"), false); + $button = Button('submit:metaedit', _("Submit")); $form = HTML::form(array('action' => $action, 'method' => 'post', 'accept-charset' => 'UTF-8'), Modified: trunk/lib/plugin/GoTo.php =================================================================== --- trunk/lib/plugin/GoTo.php 2021-06-17 17:17:35 UTC (rev 10301) +++ trunk/lib/plugin/GoTo.php 2021-06-17 17:24:11 UTC (rev 10302) @@ -83,7 +83,7 @@ 'size' => $size, 'name' => 'goto[target]')); - $button = Button('submit:goto[go]', _("Go"), false); + $button = Button('submit:goto[go]', _("Go")); $form->pushContent($textfield, $button); Modified: trunk/lib/plugin/LinkSearch.php =================================================================== --- trunk/lib/plugin/LinkSearch.php 2021-06-17 17:17:35 UTC (rev 10301) +++ trunk/lib/plugin/LinkSearch.php 2021-06-17 17:24:11 UTC (rev 10302) @@ -110,7 +110,7 @@ $direction->pushContent(HTML::option($out, _("outgoing"))); $direction->pushContent(HTML::option($in, _("incoming"))); */ - $submit = Button('submit:search', _("LinkSearch"), false); + $submit = Button('submit:search', _("LinkSearch")); $instructions = _("Search in pages for links with the matching name."); $form = HTML::form(array('action' => $action, 'method' => 'get', Modified: trunk/lib/plugin/SemanticSearch.php =================================================================== --- trunk/lib/plugin/SemanticSearch.php 2021-06-17 17:17:35 UTC (rev 10301) +++ trunk/lib/plugin/SemanticSearch.php 2021-06-17 17:24:11 UTC (rev 10302) @@ -124,7 +124,7 @@ 'autocomplete_matchsubstring' => 'true', 'autocomplete_list' => 'xmlrpc:wiki.titleSearch ^[S] 4' ), ''); - $relsubmit = Button('submit:semsearch[relations]', _("Relations"), false); + $relsubmit = Button('submit:semsearch[relations]', _("Relations")); // just testing some dhtml... not yet done $enhancements = HTML(); $nbsp = HTML::raw(' '); @@ -214,7 +214,7 @@ 'title' => _("Add an OR query"))); if (DEBUG) $enhancements = HTML::span($andbutton, $nbsp, $orbutton); - $attsubmit = Button('submit:semsearch[attributes]', _("Attributes"), false); + $attsubmit = Button('submit:semsearch[attributes]', _("Attributes")); $instructions = HTML::span(_("Search in pages for an attribute with that numeric value."), "\n"); if (DEBUG) $instructions->pushContent Modified: trunk/lib/plugin/SemanticSearchAdvanced.php =================================================================== --- trunk/lib/plugin/SemanticSearchAdvanced.php 2021-06-17 17:17:35 UTC (rev 10301) +++ trunk/lib/plugin/SemanticSearchAdvanced.php 2021-06-17 17:24:11 UTC (rev 10302) @@ -95,7 +95,7 @@ 'autocomplete_matchsubstring' => 'false', 'autocomplete_list' => 'xmlrpc:wiki.titleSearch ^[S] 4' ), ''); - $help = Button('submit:semsearch[help]', "?", false); + $help = Button('submit:semsearch[help]', "?"); $svalues = empty($allrelations) ? "" : join("','", $allrelations); $reldef = JavaScript("var semsearch_relations = new Array('" . $svalues . "')"); $querybox = HTML::textarea(array('name' => 's', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-06-17 17:42:19
|
Revision: 10304 http://sourceforge.net/p/phpwiki/code/10304 Author: vargenau Date: 2021-06-17 17:42:17 +0000 (Thu, 17 Jun 2021) Log Message: ----------- default arguments not needed Modified Paths: -------------- trunk/lib/plugin/CalendarList.php trunk/lib/plugin/CreatePage.php trunk/lib/plugin/DebugBackendInfo.php trunk/lib/plugin/FullTextSearch.php trunk/lib/plugin/ModeratedPage.php trunk/lib/plugin/VisualWiki.php trunk/lib/plugin/WantedPages.php trunk/lib/plugin/WhoIsOnline.php Modified: trunk/lib/plugin/CalendarList.php =================================================================== --- trunk/lib/plugin/CalendarList.php 2021-06-17 17:36:01 UTC (rev 10303) +++ trunk/lib/plugin/CalendarList.php 2021-06-17 17:42:17 UTC (rev 10304) @@ -199,7 +199,7 @@ $end = $base + ($args['next_n_days'] * 24 * 3600.0); } elseif ($args['last_n']) { // get date for next nth event - $end = $this->_count_events($dbi, $args['next_n'], 1); + $end = $this->_count_events($dbi, $args['next_n']); } else { // trick to get last day of requested month $end = mktime(0, 0, -1, // h, m, s Modified: trunk/lib/plugin/CreatePage.php =================================================================== --- trunk/lib/plugin/CreatePage.php 2021-06-17 17:36:01 UTC (rev 10303) +++ trunk/lib/plugin/CreatePage.php 2021-06-17 17:42:17 UTC (rev 10304) @@ -157,6 +157,6 @@ $page->save($content, $version + 1, $meta); } } - return HTML($request->redirect($url, true)); + return HTML($request->redirect($url)); } } Modified: trunk/lib/plugin/DebugBackendInfo.php =================================================================== --- trunk/lib/plugin/DebugBackendInfo.php 2021-06-17 17:36:01 UTC (rev 10303) +++ trunk/lib/plugin/DebugBackendInfo.php 2021-06-17 17:42:17 UTC (rev 10304) @@ -117,7 +117,7 @@ while ($rel = $relations->next()) $table->pushContent($this->_showhash(false, $rel)); } - $linkdata = $backend->get_links($page, true); + $linkdata = $backend->get_links($page); if ($linkdata->count()) $table->pushContent($this->_showhash("get_backlinks('$page')", $linkdata->asArray())); Modified: trunk/lib/plugin/FullTextSearch.php =================================================================== --- trunk/lib/plugin/FullTextSearch.php 2021-06-17 17:36:01 UTC (rev 10303) +++ trunk/lib/plugin/FullTextSearch.php 2021-06-17 17:42:17 UTC (rev 10304) @@ -209,7 +209,7 @@ { $pagename = $page_handle->getName(); $count = count($this->parentobj->_wpagelist[$pagename]); - return LinkURL(WikiURL($page_handle, array('action' => 'BackLinks'), false), + return LinkURL(WikiURL($page_handle, array('action' => 'BackLinks')), fmt("(%d Links)", $count)); } } Modified: trunk/lib/plugin/ModeratedPage.php =================================================================== --- trunk/lib/plugin/ModeratedPage.php 2021-06-17 17:36:01 UTC (rev 10303) +++ trunk/lib/plugin/ModeratedPage.php 2021-06-17 17:42:17 UTC (rev 10304) @@ -347,7 +347,7 @@ // timestamp,user(obj)+userid // handle $moderated['data'][$id]['args']['action'] } else { - return $this->approval_form($request, $args, $moderation, 'approve'); + return $this->approval_form($request, $args, $moderation); } return ''; } @@ -428,7 +428,7 @@ if ($moderation['args']['action'] == 'edit') { $pagename = $moderation['args']['pagename']; $p = $request->_dbi->getPage($pagename); - $rev = $p->getCurrentRevision(true); + $rev = $p->getCurrentRevision(); $curr_content = $rev->getPackedContent(); $new_content = $moderation['args']['edit']['content']; include_once 'lib/difflib.php'; Modified: trunk/lib/plugin/VisualWiki.php =================================================================== --- trunk/lib/plugin/VisualWiki.php 2021-06-17 17:36:01 UTC (rev 10303) +++ trunk/lib/plugin/VisualWiki.php 2021-06-17 17:42:17 UTC (rev 10304) @@ -319,7 +319,7 @@ // false = get links from actual page // true = get links to actual page ("backlinks") - $backlinks = $page->getLinks(true); + $backlinks = $page->getLinks(); unset($bconnection); $bconnection = array(); while ($blink = $backlinks->next()) { Modified: trunk/lib/plugin/WantedPages.php =================================================================== --- trunk/lib/plugin/WantedPages.php 2021-06-17 17:36:01 UTC (rev 10303) +++ trunk/lib/plugin/WantedPages.php 2021-06-17 17:42:17 UTC (rev 10304) @@ -205,7 +205,7 @@ { $pagename = $page_handle->getName(); $count = count($this->parentobj->_wpagelist[$pagename]); - return LinkURL(WikiURL($page, array('action' => 'BackLinks'), false), + return LinkURL(WikiURL($page, array('action' => 'BackLinks')), fmt("(%d Links)", $count)); } } Modified: trunk/lib/plugin/WhoIsOnline.php =================================================================== --- trunk/lib/plugin/WhoIsOnline.php 2021-06-17 17:36:01 UTC (rev 10303) +++ trunk/lib/plugin/WhoIsOnline.php 2021-06-17 17:42:17 UTC (rev 10304) @@ -87,7 +87,7 @@ function box($args = '', $request = null, $basepage = '') { if (!$request) $request =& $GLOBALS['request']; - $stats = $this->getStats($request->_dbi, $request, 'summary'); + $stats = $this->getStats($request->_dbi, $request); return $this->makeBox(_("Who is Online"), HTML(HTML::ul(HTML::li( WikiLink(_("WhoIsOnline"), 'auto', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-06-24 17:13:14
|
Revision: 10324 http://sourceforge.net/p/phpwiki/code/10324 Author: vargenau Date: 2021-06-24 17:13:14 +0000 (Thu, 24 Jun 2021) Log Message: ----------- WikicreoleTable.php and RichTable.php: check line lenght Modified Paths: -------------- trunk/lib/plugin/RichTable.php trunk/lib/plugin/WikicreoleTable.php Modified: trunk/lib/plugin/RichTable.php =================================================================== --- trunk/lib/plugin/RichTable.php 2021-06-24 12:48:16 UTC (rev 10323) +++ trunk/lib/plugin/RichTable.php 2021-06-24 17:13:14 UTC (rev 10324) @@ -111,18 +111,20 @@ $row->pushContent($cell); } $cell = HTML::td(); - $line = substr($line, 1); - if ($line[0] == "*") { - $attrs = parse_attributes(substr($line, 1)); - foreach ($attrs as $key => $value) { - if (in_array($key, array("id", "class", "title", "style", - "colspan", "rowspan", "width", "height", - "bgcolor", "align", "valign")) - ) { - $cell->setAttr($key, $value); + if (strlen($line) > 1) { + $line = substr($line, 1); + if ($line[0] == "*") { + $attrs = parse_attributes(substr($line, 1)); + foreach ($attrs as $key => $value) { + if (in_array($key, array("id", "class", "title", "style", + "colspan", "rowspan", "width", "height", + "bgcolor", "align", "valign")) + ) { + $cell->setAttr($key, $value); + } } + continue; } - continue; } } if (isset($row) and isset($cell)) { Modified: trunk/lib/plugin/WikicreoleTable.php =================================================================== --- trunk/lib/plugin/WikicreoleTable.php 2021-06-24 12:48:16 UTC (rev 10323) +++ trunk/lib/plugin/WikicreoleTable.php 2021-06-24 17:13:14 UTC (rev 10324) @@ -91,7 +91,7 @@ if ($line[strlen($line) - 1] == '|') { $line = substr($line, 0, -1); } - if ($line[0] == '|') { + if ((strlen($line) > 0) && ($line[0] == '|')) { $table[] = $this->parse_row($line); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-07-27 10:42:44
|
Revision: 10365 http://sourceforge.net/p/phpwiki/code/10365 Author: vargenau Date: 2021-07-27 10:42:42 +0000 (Tue, 27 Jul 2021) Log Message: ----------- Add spacing between buttons Modified Paths: -------------- trunk/lib/plugin/WikiAdminChown.php trunk/lib/plugin/WikiAdminPurge.php trunk/lib/plugin/WikiAdminRemove.php trunk/lib/plugin/WikiAdminRename.php trunk/lib/plugin/WikiAdminSearchReplace.php trunk/lib/plugin/WikiAdminSelect.php trunk/lib/plugin/WikiAdminSetAcl.php trunk/lib/plugin/WikiAdminSetAclSimple.php trunk/lib/plugin/WikiAdminSetExternal.php trunk/lib/plugin/WikiAdminUtils.php Modified: trunk/lib/plugin/WikiAdminChown.php =================================================================== --- trunk/lib/plugin/WikiAdminChown.php 2021-07-26 09:15:12 UTC (rev 10364) +++ trunk/lib/plugin/WikiAdminChown.php 2021-07-27 10:42:42 UTC (rev 10365) @@ -180,7 +180,8 @@ 'size' => 40))); $buttons = HTML::p(Button('submit:admin_chown[chown]', $button_label, 'wikiadmin'), - Button('submit:admin_chown[cancel]', _("Cancel"), 'button')); + HTML::raw(" "), + Button('submit:admin_chown[cancel]', _("Cancel"), 'button')); $header->pushContent($buttons); return HTML::form(array('action' => $request->getPostURL(), Modified: trunk/lib/plugin/WikiAdminPurge.php =================================================================== --- trunk/lib/plugin/WikiAdminPurge.php 2021-07-26 09:15:12 UTC (rev 10364) +++ trunk/lib/plugin/WikiAdminPurge.php 2021-07-27 10:42:42 UTC (rev 10365) @@ -162,7 +162,8 @@ } $buttons = HTML::p(Button('submit:admin_purge[purge]', $button_label, 'wikiadmin'), - Button('submit:admin_purge[cancel]', _("Cancel"), 'button')); + HTML::raw(" "), + Button('submit:admin_purge[cancel]', _("Cancel"), 'button')); $header->pushContent($buttons); return HTML::form(array('action' => $request->getPostURL(), Modified: trunk/lib/plugin/WikiAdminRemove.php =================================================================== --- trunk/lib/plugin/WikiAdminRemove.php 2021-07-26 09:15:12 UTC (rev 10364) +++ trunk/lib/plugin/WikiAdminRemove.php 2021-07-27 10:42:42 UTC (rev 10365) @@ -231,7 +231,8 @@ } $buttons = HTML::p(Button('submit:admin_remove[remove]', $button_label, 'wikiadmin'), - Button('submit:admin_remove[cancel]', _("Cancel"), 'button')); + HTML::raw(" "), + Button('submit:admin_remove[cancel]', _("Cancel"), 'button')); $header->pushContent($buttons); // TODO: quick select by regex javascript? Modified: trunk/lib/plugin/WikiAdminRename.php =================================================================== --- trunk/lib/plugin/WikiAdminRename.php 2021-07-26 09:15:12 UTC (rev 10364) +++ trunk/lib/plugin/WikiAdminRename.php 2021-07-27 10:42:42 UTC (rev 10365) @@ -167,9 +167,9 @@ } } - $buttons = HTML::p - (Button('submit:admin_rename[rename]', $button_label, 'wikiadmin'), - Button('submit:admin_rename[cancel]', _("Cancel"), 'button')); + $buttons = HTML::p(Button('submit:admin_rename[rename]', $button_label, 'wikiadmin'), + HTML::raw(" "), + Button('submit:admin_rename[cancel]', _("Cancel"), 'button')); if ($singlepage === false) { $list = $pagelist->getContent(); Modified: trunk/lib/plugin/WikiAdminSearchReplace.php =================================================================== --- trunk/lib/plugin/WikiAdminSearchReplace.php 2021-07-26 09:15:12 UTC (rev 10364) +++ trunk/lib/plugin/WikiAdminSearchReplace.php 2021-07-27 10:42:42 UTC (rev 10365) @@ -142,7 +142,8 @@ } $buttons = HTML::p(Button('submit:admin_replace[replace]', $button_label, 'wikiadmin'), - Button('submit:admin_replace[cancel]', _("Cancel"), 'button')); + HTML::raw(" "), + Button('submit:admin_replace[cancel]', _("Cancel"), 'button')); $header->pushContent($buttons); $result->pushContent(HTML::form(array('action' => $request->getPostURL(), Modified: trunk/lib/plugin/WikiAdminSelect.php =================================================================== --- trunk/lib/plugin/WikiAdminSelect.php 2021-07-26 09:15:12 UTC (rev 10364) +++ trunk/lib/plugin/WikiAdminSelect.php 2021-07-27 10:42:42 UTC (rev 10365) @@ -163,9 +163,9 @@ $form->pushContent(HTML::input(array('type' => 'hidden', 'name' => 'action', 'value' => 'verify'))); - $form->pushContent(Button('submit:verify', _("Select pages"), - 'wikiadmin'), - Button('submit:cancel', _("Cancel"), 'button')); + $form->pushContent(Button('submit:verify', _("Select pages"), 'wikiadmin'), + HTML::raw(" "), + Button('submit:cancel', _("Cancel"), 'button')); } else { global $WikiTheme; $form->pushContent(HTML::input(array('type' => 'hidden', Modified: trunk/lib/plugin/WikiAdminSetAcl.php =================================================================== --- trunk/lib/plugin/WikiAdminSetAcl.php 2021-07-26 09:15:12 UTC (rev 10364) +++ trunk/lib/plugin/WikiAdminSetAcl.php 2021-07-27 10:42:42 UTC (rev 10365) @@ -223,7 +223,8 @@ } $buttons = HTML::p(Button('submit:admin_setacl[acl]', $button_label, 'wikiadmin'), - Button('submit:admin_setacl[cancel]', _("Cancel"), 'button')); + HTML::raw(" "), + Button('submit:admin_setacl[cancel]', _("Cancel"), 'button')); $header->pushContent($buttons); return HTML::form(array('action' => $request->getPostURL(), Modified: trunk/lib/plugin/WikiAdminSetAclSimple.php =================================================================== --- trunk/lib/plugin/WikiAdminSetAclSimple.php 2021-07-26 09:15:12 UTC (rev 10364) +++ trunk/lib/plugin/WikiAdminSetAclSimple.php 2021-07-27 10:42:42 UTC (rev 10365) @@ -104,7 +104,8 @@ $header->pushContent(HTML::legend(_("Select the pages where to change access rights"))); $buttons = HTML::p(Button('submit:admin_setacl[aclliberal]', $button_label_liberal, 'wikiadmin'), - Button('submit:admin_setacl[aclrestricted]', $button_label_restrictive, 'wikiadmin')); + HTML::raw(" "), + Button('submit:admin_setacl[aclrestricted]', $button_label_restrictive, 'wikiadmin')); $header->pushContent($buttons); return HTML::form(array('action' => $request->getPostURL(), Modified: trunk/lib/plugin/WikiAdminSetExternal.php =================================================================== --- trunk/lib/plugin/WikiAdminSetExternal.php 2021-07-26 09:15:12 UTC (rev 10364) +++ trunk/lib/plugin/WikiAdminSetExternal.php 2021-07-27 10:42:42 UTC (rev 10365) @@ -138,7 +138,8 @@ $header->pushContent(HTML::legend(_("Select the pages to set as external"))); $buttons = HTML::p(Button('submit:admin_external[button]', $button_label, 'wikiadmin'), - Button('submit:admin_external[cancel]', _("Cancel"), 'button')); + HTML::raw(" "), + Button('submit:admin_external[cancel]', _("Cancel"), 'button')); $header->pushContent($buttons); return HTML::form(array('action' => $request->getPostURL(), Modified: trunk/lib/plugin/WikiAdminUtils.php =================================================================== --- trunk/lib/plugin/WikiAdminUtils.php 2021-07-26 09:15:12 UTC (rev 10364) +++ trunk/lib/plugin/WikiAdminUtils.php 2021-07-27 10:42:42 UTC (rev 10365) @@ -300,10 +300,9 @@ WIKIAUTH_ADMIN)), HiddenInputs($request->getArgs()), $pagelist->_generateTable(), - HTML::p(Button('submit:', _("Change Verification Status"), - 'wikiadmin'), - HTML::raw(' '), - Button('cancel', _("Cancel"))) + HTML::p(Button('submit:', _("Change Verification Status"), 'wikiadmin'), + HTML::raw(' '), + Button('cancel', _("Cancel"))) ); } return HTML::raw(''); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-08-03 17:18:03
|
Revision: 10418 http://sourceforge.net/p/phpwiki/code/10418 Author: vargenau Date: 2021-08-03 17:18:02 +0000 (Tue, 03 Aug 2021) Log Message: ----------- Allow XHTML dump of pages LdapSearch and UriResolver Modified Paths: -------------- trunk/lib/plugin/LdapSearch.php trunk/lib/plugin/UriResolver.php Modified: trunk/lib/plugin/LdapSearch.php =================================================================== --- trunk/lib/plugin/LdapSearch.php 2021-08-03 16:59:09 UTC (rev 10417) +++ trunk/lib/plugin/LdapSearch.php 2021-08-03 17:18:02 UTC (rev 10418) @@ -79,6 +79,12 @@ */ function run($dbi, $argstr, &$request, $basepage) { + + global $WikiTheme; + if ($WikiTheme->DUMP_MODE) { + return HTML::p(); + } + $args = $this->getArgs($argstr, $request); extract($args); //include_once("lib/WikiUser/LDAP.php"); Modified: trunk/lib/plugin/UriResolver.php =================================================================== --- trunk/lib/plugin/UriResolver.php 2021-08-03 16:59:09 UTC (rev 10417) +++ trunk/lib/plugin/UriResolver.php 2021-08-03 17:18:02 UTC (rev 10418) @@ -59,6 +59,10 @@ */ function run($dbi, $argstr, &$request, $basepage) { + global $WikiTheme; + if ($WikiTheme->DUMP_MODE) { + return ''; + } $args = $request->getArgs(); unset($args['pagename']); unset($args['action']); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-08-06 10:34:35
|
Revision: 10450 http://sourceforge.net/p/phpwiki/code/10450 Author: vargenau Date: 2021-08-06 10:34:32 +0000 (Fri, 06 Aug 2021) Log Message: ----------- Remove "abs_path" Modified Paths: -------------- trunk/lib/plugin/RedirectTo.php trunk/lib/plugin/WikiAdminUtils.php Modified: trunk/lib/plugin/RedirectTo.php =================================================================== --- trunk/lib/plugin/RedirectTo.php 2021-08-06 10:24:32 UTC (rev 10449) +++ trunk/lib/plugin/RedirectTo.php 2021-08-06 10:34:32 UTC (rev 10450) @@ -80,9 +80,7 @@ return $this->disabled(_("Redirect to an external URL is only allowed in locked pages.")); } } elseif ($page) { - $url = WikiURL($page, - array('redirectfrom' => $request->getArg('pagename')), - 'abs_path'); + $url = WikiURL($page, array('redirectfrom' => $request->getArg('pagename'))); } else { return $this->error(_("'href' or 'page' parameter missing.")); } @@ -97,9 +95,9 @@ $redirectfrom = $request->getArg('redirectfrom'); if ($redirectfrom !== false) { - if ($redirectfrom) + if ($redirectfrom) { return $this->disabled(_("Double redirect not allowed.")); - else { + } else { // Got here by following the "Redirected from ..." link // on a browse page. return $this->disabled(_("Viewing redirecting page.")); Modified: trunk/lib/plugin/WikiAdminUtils.php =================================================================== --- trunk/lib/plugin/WikiAdminUtils.php 2021-08-06 10:24:32 UTC (rev 10449) +++ trunk/lib/plugin/WikiAdminUtils.php 2021-08-06 10:34:32 UTC (rev 10450) @@ -112,9 +112,7 @@ if (strpos($return_url, '?')) { $return_url = substr($return_url, 0, strpos($return_url, '?')); } - $url = WikiURL($return_url, - array('warningmsg' => $message), - 'abs_path'); + $url = WikiURL($return_url, array('warningmsg' => $message)); return $request->redirect($url); } 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...> - 2022-01-02 14:29:08
|
Revision: 10805 http://sourceforge.net/p/phpwiki/code/10805 Author: vargenau Date: 2022-01-02 14:29:06 +0000 (Sun, 02 Jan 2022) Log Message: ----------- WikiAdminRemove: remove 'min_age' and 'max_age' arguments; 'info' is already in WikiAdminSelect Modified Paths: -------------- trunk/lib/plugin/WikiAdminPurge.php trunk/lib/plugin/WikiAdminRemove.php Modified: trunk/lib/plugin/WikiAdminPurge.php =================================================================== --- trunk/lib/plugin/WikiAdminPurge.php 2022-01-02 12:05:05 UTC (rev 10804) +++ trunk/lib/plugin/WikiAdminPurge.php 2022-01-02 14:29:06 UTC (rev 10805) @@ -39,8 +39,6 @@ return _("Permanently purge selected pages")."."; } - /* getDefaultArguments() is inherited from WikiAdminSelect class */ - protected function collectPages(&$list, &$dbi, $sortby, $limit = 0, $exclude = '') { Modified: trunk/lib/plugin/WikiAdminRemove.php =================================================================== --- trunk/lib/plugin/WikiAdminRemove.php 2022-01-02 12:05:05 UTC (rev 10804) +++ trunk/lib/plugin/WikiAdminRemove.php 2022-01-02 14:29:06 UTC (rev 10805) @@ -25,7 +25,7 @@ /** * Usage: <<WikiAdminRemove>> - * Author: Reini Urban <ru...@x-...> + * Author: Reini Urban * * KNOWN ISSUES: * Currently we must be Admin. @@ -43,58 +43,18 @@ return _("Remove selected pages")."."; } - function getDefaultArguments() - { - return array_merge - ( - parent::getDefaultArguments(), - array( - /* - * Show only pages which have been 'deleted' this - * long (in days). (negative or non-numeric - * means show all pages, even non-deleted ones.) - * - * FIXME: could use a better name. - */ - 'min_age' => 0, - - /* - * Automatically check the checkboxes for files - * which have been 'deleted' this long (in days). - * - * FIXME: could use a better name. - */ - 'max_age' => 31, - /* Columns to include in listing */ - 'info' => 'most', - )); - } - protected function collectPages(&$list, &$dbi, $sortby, $limit = 0, $exclude = '') { - extract($this->_args); - $now = time(); - $allPages = $dbi->getAllPages('include_empty', $sortby, $limit); while ($pagehandle = $allPages->next()) { $pagename = $pagehandle->getName(); $current = $pagehandle->getCurrentRevision(); - if ($current->getVersion() < 1) + if ($current->getVersion() < 1) { continue; // No versions in database - - $empty = $current->hasDefaultContents(); - if ($empty) { - $age = ($now - $current->get('mtime')) / (24 * 3600.0); - $checked = $age >= $max_age; - } else { - $age = 0; - $checked = false; } - - if ($age >= $min_age) { - if (empty($list[$pagename])) - $list[$pagename] = $checked; + if (empty($list[$pagename])) { + $list[$pagename] = false; } } return $list; @@ -148,13 +108,7 @@ } $args = $this->getArgs($argstr, $request); - if (!is_numeric($args['min_age'])) - $args['min_age'] = -1; - $this->_args =& $args; - /*if (!empty($args['exclude'])) - $exclude = explodePageList($args['exclude']); - else - $exclude = false;*/ + $this->_args = $args; $this->preSelectS($args, $request); $p = $request->getArg('p'); @@ -166,7 +120,6 @@ if ($p && $request->isPost() && !empty($post_args['remove']) && empty($post_args['cancel']) ) { - // check individual PagePermissions if (!ENABLE_PAGEPERM and !$request->_user->isAdmin()) { $request->_notAuthorized(WIKIAUTH_ADMIN); @@ -176,7 +129,6 @@ // Real delete. return $this->removePages($request, array_keys($p)); } - if ($post_args['action'] == 'select') { $next_action = 'verify'; foreach ($p as $name => $c) { @@ -201,28 +153,16 @@ $pagelist = new PageList_Selectable($args['info'], $args['exclude'], array('types' => array('remove' - => new _PageList_Column_remove('remove', _("Remove"))))); + => new PageList_Column_remove('remove', _("Remove"))))); $pagelist->addPageList($pages); if ($next_action == 'verify') { $button_label = _("Yes"); $header->pushContent(HTML::legend(_("Confirm removal"))); $header->pushContent(HTML::p(HTML::strong( - _("Are you sure you want to remove the selected pages?")))); + _("Are you sure you want to remove the following pages?")))); } else { $button_label = _("Remove selected pages"); $header->pushContent(HTML::legend(_("Select the pages to remove"))); - if ($args['min_age'] > 0) { - $header->pushContent( - fmt("Also pages which have been deleted at least %s days.", - $args['min_age'])); - } - - if ($args['max_age'] > 0) { - $header->pushContent( - " ", - fmt("Pages which have been deleted at least %s days are already checked.", - $args['max_age'])); - } } $buttons = HTML::p(Button('submit:admin_remove[remove]', $button_label, 'wikiadmin'), @@ -230,7 +170,6 @@ Button('submit:admin_remove[cancel]', _("Cancel"), 'button')); $header->pushContent($buttons); - // TODO: quick select by regex javascript? return HTML::form(array('action' => $request->getPostURL(), 'method' => 'post'), $header, @@ -243,7 +182,7 @@ } } -class _PageList_Column_remove extends _PageList_Column +class PageList_Column_remove extends _PageList_Column { function _getValue($page_handle, $revision_handle) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2022-01-05 20:28:44
|
Revision: 10838 http://sourceforge.net/p/phpwiki/code/10838 Author: vargenau Date: 2022-01-05 20:28:41 +0000 (Wed, 05 Jan 2022) Log Message: ----------- Better error message Modified Paths: -------------- trunk/lib/plugin/DebugAuthInfo.php trunk/lib/plugin/DebugBackendInfo.php trunk/lib/plugin/WikiAdminChown.php trunk/lib/plugin/WikiAdminDeleteAcl.php trunk/lib/plugin/WikiAdminPurge.php trunk/lib/plugin/WikiAdminRemove.php trunk/lib/plugin/WikiAdminRename.php trunk/lib/plugin/WikiAdminSearchReplace.php trunk/lib/plugin/WikiAdminSelect.php trunk/lib/plugin/WikiAdminSetAcl.php trunk/lib/plugin/WikiAdminSetAclSimple.php trunk/lib/plugin/WikiAdminSetExternal.php Modified: trunk/lib/plugin/DebugAuthInfo.php =================================================================== --- trunk/lib/plugin/DebugAuthInfo.php 2022-01-05 18:14:09 UTC (rev 10837) +++ trunk/lib/plugin/DebugAuthInfo.php 2022-01-05 20:28:41 UTC (rev 10838) @@ -64,7 +64,7 @@ } if (!$user->isAdmin() and !(DEBUG && _DEBUG_LOGIN)) { $request->_notAuthorized(WIKIAUTH_ADMIN); - $this->disabled("! user->isAdmin"); + $this->disabled(_("You must be an administrator to use this plugin.")); } $html = HTML(HTML::h2(fmt("General Auth Settings"))); Modified: trunk/lib/plugin/DebugBackendInfo.php =================================================================== --- trunk/lib/plugin/DebugBackendInfo.php 2022-01-05 18:14:09 UTC (rev 10837) +++ trunk/lib/plugin/DebugBackendInfo.php 2022-01-05 20:28:41 UTC (rev 10838) @@ -62,7 +62,7 @@ if (!$user->isAdmin() and !(DEBUG && _DEBUG_LOGIN)) { $request->_notAuthorized(WIKIAUTH_ADMIN); - $this->disabled("! user->isAdmin"); + $this->disabled(_("You must be an administrator to use this plugin.")); } if (empty($page)) { Modified: trunk/lib/plugin/WikiAdminChown.php =================================================================== --- trunk/lib/plugin/WikiAdminChown.php 2022-01-05 18:14:09 UTC (rev 10837) +++ trunk/lib/plugin/WikiAdminChown.php 2022-01-05 20:28:41 UTC (rev 10838) @@ -25,7 +25,7 @@ /** * Usage: <<WikiAdminChown s||=* >> or called via WikiAdminSelect - * @author: Reini Urban <ru...@x-...> + * @author: Reini Urban * */ @@ -142,7 +142,7 @@ // without individual PagePermissions: if (!ENABLE_PAGEPERM and !$request->_user->isAdmin()) { $request->_notAuthorized(WIKIAUTH_ADMIN); - $this->disabled("! user->isAdmin"); + $this->disabled(_("You must be an administrator to use this plugin.")); } if ($post_args['action'] == 'verify') { // Real action Modified: trunk/lib/plugin/WikiAdminDeleteAcl.php =================================================================== --- trunk/lib/plugin/WikiAdminDeleteAcl.php 2022-01-05 18:14:09 UTC (rev 10837) +++ trunk/lib/plugin/WikiAdminDeleteAcl.php 2022-01-05 20:28:41 UTC (rev 10838) @@ -111,7 +111,7 @@ if ($p && $request->isPost()) { if (!ENABLE_PAGEPERM and !$request->_user->isAdmin()) { $request->_notAuthorized(WIKIAUTH_ADMIN); - $this->disabled("! user->isAdmin"); + $this->disabled(_("You must be an administrator to use this plugin.")); } return $this->deleteaclPages($request, array_keys($p)); } Modified: trunk/lib/plugin/WikiAdminPurge.php =================================================================== --- trunk/lib/plugin/WikiAdminPurge.php 2022-01-05 18:14:09 UTC (rev 10837) +++ trunk/lib/plugin/WikiAdminPurge.php 2022-01-05 20:28:41 UTC (rev 10838) @@ -1,5 +1,5 @@ <?php -/* +/** * Copyright © 2002,2004 $ThePhpWikiProgrammingTeam * Copyright © 2009 Marc-Etienne Vargenau, Alcatel-Lucent * @@ -119,7 +119,7 @@ // check individual PagePermissions if (!ENABLE_PAGEPERM and !$request->_user->isAdmin()) { $request->_notAuthorized(WIKIAUTH_ADMIN); - $this->disabled("! user->isAdmin"); + $this->disabled(_("You must be an administrator to use this plugin.")); } if ($post_args['action'] == 'verify') { // Real purge. Modified: trunk/lib/plugin/WikiAdminRemove.php =================================================================== --- trunk/lib/plugin/WikiAdminRemove.php 2022-01-05 18:14:09 UTC (rev 10837) +++ trunk/lib/plugin/WikiAdminRemove.php 2022-01-05 20:28:41 UTC (rev 10838) @@ -123,7 +123,7 @@ // check individual PagePermissions if (!ENABLE_PAGEPERM and !$request->_user->isAdmin()) { $request->_notAuthorized(WIKIAUTH_ADMIN); - $this->disabled("! user->isAdmin"); + $this->disabled(_("You must be an administrator to use this plugin.")); } if ($post_args['action'] == 'verify') { // Real delete. Modified: trunk/lib/plugin/WikiAdminRename.php =================================================================== --- trunk/lib/plugin/WikiAdminRename.php 2022-01-05 18:14:09 UTC (rev 10837) +++ trunk/lib/plugin/WikiAdminRename.php 2022-01-05 20:28:41 UTC (rev 10838) @@ -25,7 +25,7 @@ /** * Usage: <<WikiAdminRename >> or called via WikiAdminSelect - * @author: Reini Urban <ru...@x-...> + * @author: Reini Urban * */ @@ -109,7 +109,7 @@ // without individual PagePermissions: if (!ENABLE_PAGEPERM and !$request->_user->isAdmin()) { $request->_notAuthorized(WIKIAUTH_ADMIN); - $this->disabled("! user->isAdmin"); + $this->disabled(_("You must be an administrator to use this plugin.")); } // DONE: error message if not allowed. if ($post_args['action'] == 'verify') { Modified: trunk/lib/plugin/WikiAdminSearchReplace.php =================================================================== --- trunk/lib/plugin/WikiAdminSearchReplace.php 2022-01-05 18:14:09 UTC (rev 10837) +++ trunk/lib/plugin/WikiAdminSearchReplace.php 2022-01-05 20:28:41 UTC (rev 10838) @@ -25,7 +25,7 @@ /** * Usage: <<WikiAdminSearchReplace >> or called via WikiAdminSelect - * Author: Reini Urban <ru...@x-...> + * Author: Reini Urban * */ Modified: trunk/lib/plugin/WikiAdminSelect.php =================================================================== --- trunk/lib/plugin/WikiAdminSelect.php 2022-01-05 18:14:09 UTC (rev 10837) +++ trunk/lib/plugin/WikiAdminSelect.php 2022-01-05 20:28:41 UTC (rev 10838) @@ -28,7 +28,7 @@ * WikiAdmin plugins then. Then do Rename, Remove, Chown, ... * * Usage: <<WikiAdminSelect>> - * Author: Reini Urban <ru...@x-...> + * Author: Reini Urban * * This is the base class for most WikiAdmin* classes, using * collectPages() and preSelectS(). Modified: trunk/lib/plugin/WikiAdminSetAcl.php =================================================================== --- trunk/lib/plugin/WikiAdminSetAcl.php 2022-01-05 18:14:09 UTC (rev 10837) +++ trunk/lib/plugin/WikiAdminSetAcl.php 2022-01-05 20:28:41 UTC (rev 10838) @@ -27,7 +27,7 @@ * Set individual PagePermissions * * Usage: <<WikiAdminSetAcl >> or called via WikiAdminSelect - * Author: Reini Urban <ru...@x-...> + * Author: Reini Urban * * TODO: UI to add custom group/username. * Currently it's easier to dump a page, fix it manually and @@ -175,7 +175,7 @@ // without individual PagePermissions: if (!ENABLE_PAGEPERM and !$request->_user->isAdmin()) { $request->_notAuthorized(WIKIAUTH_ADMIN); - $this->disabled("! user->isAdmin"); + $this->disabled(_("You must be an administrator to use this plugin.")); } if ($post_args['action'] == 'verify') { // Real action Modified: trunk/lib/plugin/WikiAdminSetAclSimple.php =================================================================== --- trunk/lib/plugin/WikiAdminSetAclSimple.php 2022-01-05 18:14:09 UTC (rev 10837) +++ trunk/lib/plugin/WikiAdminSetAclSimple.php 2022-01-05 20:28:41 UTC (rev 10838) @@ -28,7 +28,6 @@ * * Usage: <<WikiAdminSetAclSimple >> or called via WikiAdminSelect * Author: Marc-Etienne Vargenau, Alcatel-Lucent - * */ require_once 'lib/plugin/WikiAdminSetAcl.php'; @@ -79,7 +78,7 @@ // without individual PagePermissions: if (!ENABLE_PAGEPERM and !$request->_user->isAdmin()) { $request->_notAuthorized(WIKIAUTH_ADMIN); - $this->disabled("! user->isAdmin"); + $this->disabled(_("You must be an administrator to use this plugin.")); } if (!empty($post_args['aclliberal'])) { return $this->setaclPages($request, array_keys($p), $this->liberalPerms()); Modified: trunk/lib/plugin/WikiAdminSetExternal.php =================================================================== --- trunk/lib/plugin/WikiAdminSetExternal.php 2022-01-05 18:14:09 UTC (rev 10837) +++ trunk/lib/plugin/WikiAdminSetExternal.php 2022-01-05 20:28:41 UTC (rev 10838) @@ -126,7 +126,7 @@ // without individual PagePermissions: if (!ENABLE_PAGEPERM and !$request->_user->isAdmin()) { $request->_notAuthorized(WIKIAUTH_ADMIN); - $this->disabled("! user->isAdmin"); + $this->disabled(_("You must be an administrator to use this plugin.")); } // Real action return $this->setExternalPages($dbi, array_keys($p)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2022-01-06 10:43:13
|
Revision: 10846 http://sourceforge.net/p/phpwiki/code/10846 Author: vargenau Date: 2022-01-06 10:43:10 +0000 (Thu, 06 Jan 2022) Log Message: ----------- lib/plugin/WikiAdminPurge.php and lib/plugin/WikiAdminRemove.php: without individual PagePermissions Modified Paths: -------------- trunk/lib/plugin/WikiAdminPurge.php trunk/lib/plugin/WikiAdminRemove.php Modified: trunk/lib/plugin/WikiAdminPurge.php =================================================================== --- trunk/lib/plugin/WikiAdminPurge.php 2022-01-06 10:41:31 UTC (rev 10845) +++ trunk/lib/plugin/WikiAdminPurge.php 2022-01-06 10:43:10 UTC (rev 10846) @@ -117,7 +117,7 @@ if ($p && $request->isPost() && !empty($post_args['purge']) && empty($post_args['cancel']) ) { - // check individual PagePermissions + // without individual PagePermissions: if (!ENABLE_PAGEPERM and !$request->_user->isAdmin()) { $request->_notAuthorized(WIKIAUTH_ADMIN); $this->disabled(_("You must be an administrator to use this plugin.")); Modified: trunk/lib/plugin/WikiAdminRemove.php =================================================================== --- trunk/lib/plugin/WikiAdminRemove.php 2022-01-06 10:41:31 UTC (rev 10845) +++ trunk/lib/plugin/WikiAdminRemove.php 2022-01-06 10:43:10 UTC (rev 10846) @@ -121,7 +121,7 @@ if ($p && $request->isPost() && !empty($post_args['remove']) && empty($post_args['cancel']) ) { - // check individual PagePermissions + // without individual PagePermissions: if (!ENABLE_PAGEPERM and !$request->_user->isAdmin()) { $request->_notAuthorized(WIKIAUTH_ADMIN); $this->disabled(_("You must be an administrator to use this plugin.")); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2022-01-13 16:58:35
|
Revision: 10896 http://sourceforge.net/p/phpwiki/code/10896 Author: vargenau Date: 2022-01-13 16:58:32 +0000 (Thu, 13 Jan 2022) Log Message: ----------- function redirect does not return Modified Paths: -------------- trunk/lib/plugin/AppendText.php trunk/lib/plugin/CreatePage.php trunk/lib/plugin/RedirectTo.php trunk/lib/plugin/UserPreferences.php trunk/lib/plugin/WikiTranslation.php Modified: trunk/lib/plugin/AppendText.php =================================================================== --- trunk/lib/plugin/AppendText.php 2022-01-13 16:08:30 UTC (rev 10895) +++ trunk/lib/plugin/AppendText.php 2022-01-13 16:58:32 UTC (rev 10896) @@ -52,7 +52,7 @@ ); } - private function fallback($addtext, $oldtext, $notfound, &$message) + private function fallback($addtext, $oldtext, $notfound, $message) { $message->pushContent(sprintf(_("“%s” not found"), $notfound) . ". " . _("Appending at the end.") . "\n"); @@ -64,11 +64,10 @@ * @param string $argstr * @param WikiRequest $request * @param string $basepage - * @return mixed + * @return HTML|XmlContent */ function run($dbi, $argstr, &$request, $basepage) { - $args = $this->getArgs($argstr, $request); $redirect = $args['redirect']; @@ -95,12 +94,13 @@ } } - private function work($pagename, $args, $dbi, &$request) + private function work($pagename, $args, $dbi, $request) { if (empty($args['s'])) { if ($request->isPost()) { if ($pagename != _("AppendText")) - return HTML($request->redirect(WikiURL($pagename, array(), 'absurl'), false)); + $request->redirect(WikiURL($pagename, array(), 'absurl'), false); + return HTML(); } return HTML(); } @@ -151,16 +151,17 @@ // AppendText has been called from the same page that got modified // so we directly show the page. + $redirect = $args['redirect']; if ($request->getArg($pagename) == $pagename) { // TODO: Just invalidate the cache, if AppendText didn't // change anything before. // - return $request->redirect(WikiURL($pagename, array(), 'absurl'), false); - + $request->redirect(WikiURL($pagename, array(), 'absurl'), false); + return HTML(); // The user asked to be redirected to the modified page } elseif ($redirect) { - return $request->redirect(WikiURL($pagename, array(), 'absurl'), false); - + $request->redirect(WikiURL($pagename, array(), 'absurl'), false); + return HTML(); } else { $link = HTML::em(WikiLink($pagename)); $message->pushContent(HTML::raw(sprintf(_("Go to %s."), $link->asXML()))); Modified: trunk/lib/plugin/CreatePage.php =================================================================== --- trunk/lib/plugin/CreatePage.php 2022-01-13 16:08:30 UTC (rev 10895) +++ trunk/lib/plugin/CreatePage.php 2022-01-13 16:58:32 UTC (rev 10896) @@ -60,7 +60,7 @@ * @param string $argstr * @param WikiRequest $request * @param string $basepage - * @return mixed + * @return HTML|XmlContent */ function run($dbi, $argstr, &$request, $basepage) { @@ -137,6 +137,7 @@ $page->save($content, $version + 1, $meta); } } - return HTML($request->redirect($url)); + $request->redirect($url); + return HTML(); } } Modified: trunk/lib/plugin/RedirectTo.php =================================================================== --- trunk/lib/plugin/RedirectTo.php 2022-01-13 16:08:30 UTC (rev 10895) +++ trunk/lib/plugin/RedirectTo.php 2022-01-13 16:58:32 UTC (rev 10896) @@ -57,7 +57,7 @@ * @param string $argstr * @param WikiRequest $request * @param string $basepage - * @return mixed + * @return HTML|XmlContent */ function run($dbi, $argstr, &$request, $basepage) { @@ -111,6 +111,7 @@ } } - return $request->redirect($url); + $request->redirect($url); + return HTML(); } } Modified: trunk/lib/plugin/UserPreferences.php =================================================================== --- trunk/lib/plugin/UserPreferences.php 2022-01-13 16:08:30 UTC (rev 10895) +++ trunk/lib/plugin/UserPreferences.php 2022-01-13 16:58:32 UTC (rev 10896) @@ -93,7 +93,8 @@ $request->setArg("delete", false); if ($old_theme != THEME) { $url = WikiURL(__("UserPreferences"), array(), 'absurl')."?num=reset"; - return HTML($request->redirect($url, false)); + $request->redirect($url, false); + return HTML(); } $errmsg .= _("Your UserPreferences have been successfully reset to default."); @@ -162,7 +163,8 @@ // (mix of old and new templates) if ($new_theme && ($new_theme != $old_theme)) { $url = WikiURL(__("UserPreferences"), array(), 'absurl').'?num='.$num; - return HTML($request->redirect($url, false)); + $request->redirect($url, false); + return HTML(); } } Modified: trunk/lib/plugin/WikiTranslation.php =================================================================== --- trunk/lib/plugin/WikiTranslation.php 2022-01-13 16:08:30 UTC (rev 10895) +++ trunk/lib/plugin/WikiTranslation.php 2022-01-13 16:58:32 UTC (rev 10896) @@ -402,7 +402,8 @@ } // redirect or transclude? if ($url) { - return $request->redirect($url); + $request->redirect($url); + return HTML(); } return HTML(fmt("TODO: Google can only translate from english and french. Find a translation service for %s to language %s", WikiURL($pagename, array(), true), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2022-01-20 15:09:55
|
Revision: 10913 http://sourceforge.net/p/phpwiki/code/10913 Author: vargenau Date: 2022-01-20 15:09:53 +0000 (Thu, 20 Jan 2022) Log Message: ----------- Use https Modified Paths: -------------- trunk/lib/plugin/FacebookLike.php trunk/lib/plugin/GoogleMaps.php trunk/lib/plugin/YouTube.php Modified: trunk/lib/plugin/FacebookLike.php =================================================================== --- trunk/lib/plugin/FacebookLike.php 2022-01-20 11:19:14 UTC (rev 10912) +++ trunk/lib/plugin/FacebookLike.php 2022-01-20 15:09:53 UTC (rev 10913) @@ -62,7 +62,7 @@ $args = $this->getArgs($argstr, $request); extract($args); - //$iframe = "<iframe src=\"http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fexample.com%2Fpage%2Fto%2Flike&layout=standard&show_faces=false&width=450&action=like&colorscheme=light&height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;\" allowTransparency=\"true\"></iframe>"; + //$iframe = "<iframe src=\"https://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fexample.com%2Fpage%2Fto%2Flike&layout=standard&show_faces=false&width=450&action=like&colorscheme=light&height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;\" allowTransparency=\"true\"></iframe>"; $urlargs = array( "layout" => $layout, "show_faces" => $show_faces, @@ -72,7 +72,7 @@ "height" => $height ); $pagename = $request->getArg('pagename'); - $url = "http://www.facebook.com/plugins/like.php?" + $url = "https://www.facebook.com/plugins/like.php?" . "href=" . urlencode(WikiURL($pagename, $urlargs, true)); $url = str_replace("%3D", "=", $url); $params = array("src" => $url, Modified: trunk/lib/plugin/GoogleMaps.php =================================================================== --- trunk/lib/plugin/GoogleMaps.php 2022-01-20 11:19:14 UTC (rev 10912) +++ trunk/lib/plugin/GoogleMaps.php 2022-01-20 15:09:53 UTC (rev 10913) @@ -27,7 +27,7 @@ * * This plugin displays a marker with further infos (when clicking) on given coordinates. * Hint: You need to sign up for a Google Maps API key! - * http://www.google.com/apis/maps/signup.html + * https://www.google.com/apis/maps/signup.html * Then enter the key in config/config.ini under GOOGLE_LICENSE_KEY= * * Usage: @@ -46,8 +46,7 @@ * @author Reini Urban * * @see plugin/GooglePlugin - * http://www.giswiki.de/index.php/Google_Maps_Extensions - * http://www.google.com/apis/maps/, http://maps.google.com/ + * https://www.google.com/apis/maps/, https://maps.google.com/ * http://libgmail.sourceforge.net/googlemaps.html * * NOT YET SUPPORTED: @@ -107,7 +106,7 @@ return $this->error(_('Latitude must be a number.')); } - $maps = JavaScript('', array('src' => "http://maps.google.com/maps?file=api&v=1&key=" . GOOGLE_LICENSE_KEY)); + $maps = JavaScript('', array('src' => "https://maps.google.com/maps?file=api&v=1&key=" . GOOGLE_LICENSE_KEY)); $id = GenerateId("googlemap"); switch ($MapType) { case "Satellite": Modified: trunk/lib/plugin/YouTube.php =================================================================== --- trunk/lib/plugin/YouTube.php 2022-01-20 11:19:14 UTC (rev 10912) +++ trunk/lib/plugin/YouTube.php 2022-01-20 15:09:53 UTC (rev 10913) @@ -131,7 +131,7 @@ $t = $time ? $this->_time[$time] : 't'; $c = $category ? $this->_category[$category] : '0'; $l = $language ? $this->_language[$language] : ''; - $url = "http://www.youtube.com/browse?s=$s&t=$t&c=$c&l=$l"; + $url = "https://www.youtube.com/browse?s=$s&t=$t&c=$c&l=$l"; $m = array('', ''); if ($xml = url_get_contents($url)) { if ($index) { @@ -149,7 +149,7 @@ return $this->error(fmt("Invalid argument %s", "v")); if (strcspn($v, "-_0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")) return $this->error(fmt("Invalid argument %s", "v")); - $url = "http://www.youtube.com/v/" . $v; + $url = "https://www.youtube.com/v/" . $v; if ($autoplay) $url .= "?autoplay=1"; if ($size != 'medium') { @@ -176,9 +176,9 @@ $width = 90; $height = 60; } - // img: http://img.youtube.com/vi/KKTDRqQtPO8/2.jpg or 0.jpg + // img: https://img.youtube.com/vi/KKTDRqQtPO8/2.jpg or 0.jpg return HTML::a(array('href' => $url), - HTML::img(array('src' => "http://img.youtube.com/vi/" . + HTML::img(array('src' => "https://img.youtube.com/vi/" . $v . "/" . (($size == 'large') ? "0" : "2") . ".jpg", 'width' => $width, 'height' => $height, @@ -200,7 +200,7 @@ private function Daily_pick() { - if ($xml = url_get_contents("http://www.youtube.com/categories")) { + if ($xml = url_get_contents("https://www.youtube.com/categories")) { if (preg_match('/<div class="heading"><b>Pick of The Day<\/b><\/div>.*?<a href="\/watch\?v=(\w+)">/s', $xml, $m)) return $m[1]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2022-01-26 14:15:44
|
Revision: 10945 http://sourceforge.net/p/phpwiki/code/10945 Author: vargenau Date: 2022-01-26 14:15:41 +0000 (Wed, 26 Jan 2022) Log Message: ----------- Arguments are strings, not booleans Modified Paths: -------------- trunk/lib/plugin/WikiAdminChown.php trunk/lib/plugin/WikiAdminSelect.php Modified: trunk/lib/plugin/WikiAdminChown.php =================================================================== --- trunk/lib/plugin/WikiAdminChown.php 2022-01-26 12:15:11 UTC (rev 10944) +++ trunk/lib/plugin/WikiAdminChown.php 2022-01-26 14:15:41 UTC (rev 10945) @@ -46,7 +46,7 @@ ( parent::getDefaultArguments(), array( - 'user' => false, + 'user' => '', /* Columns to include in listing */ 'info' => 'pagename,owner,mtime', )); Modified: trunk/lib/plugin/WikiAdminSelect.php =================================================================== --- trunk/lib/plugin/WikiAdminSelect.php 2022-01-26 12:15:11 UTC (rev 10944) +++ trunk/lib/plugin/WikiAdminSelect.php 2022-01-26 14:15:41 UTC (rev 10945) @@ -52,10 +52,9 @@ { return array('s' => '', // preselect pages /* select pages by meta-data: */ - 'author' => false, - 'owner' => false, - 'creator' => false, - 'only' => '', + 'author' => '', + 'owner' => '', + 'creator' => '', 'exclude' => '', 'info' => 'most', 'sortby' => 'pagename', @@ -90,7 +89,6 @@ * Preselect a list of pagenames by the supporting the following args: * 's': comma-separated list of pagename wildcards * 'author', 'owner', 'creator': from WikiDB_Page - * 'only: forgot what the difference to 's' was. * Sets $this->_list, which is picked up by collectPages() and is a default for p[] * * @param array $args @@ -110,9 +108,9 @@ $sl = PageList::allPagesByAuthor($args['author'], false, $args['sortby'], $args['limit'], $args['exclude']); } elseif (!empty($args['creator'])) { $sl = PageList::allPagesByCreator($args['creator'], false, $args['sortby'], $args['limit'], $args['exclude']); - } elseif (!empty($args['s']) or !empty($args['only'])) { + } elseif (!empty($args['s'])) { // all pages by name - $sl = explodePageList(empty($args['only']) ? $args['s'] : $args['only']); + $sl = explodePageList($args['s']); } $this->_list = array(); if (!empty($sl)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2022-02-15 18:23:38
|
Revision: 11002 http://sourceforge.net/p/phpwiki/code/11002 Author: vargenau Date: 2022-02-15 18:23:37 +0000 (Tue, 15 Feb 2022) Log Message: ----------- lib/plugin/Calendar.php & lib/plugin/CalendarList.php: fix getWikiPageLinks function (patch by Christof Meerwald) Modified Paths: -------------- trunk/lib/plugin/Calendar.php trunk/lib/plugin/CalendarList.php Modified: trunk/lib/plugin/Calendar.php =================================================================== --- trunk/lib/plugin/Calendar.php 2022-02-15 16:58:07 UTC (rev 11001) +++ trunk/lib/plugin/Calendar.php 2022-02-15 18:23:37 UTC (rev 11002) @@ -148,12 +148,12 @@ $mday = HTML::strong($mday); $td->setAttr('class', 'cal-today'); } elseif ($dbi->isWikiPage($page_for_date)) { - $this->_links[] = $page_for_date; + $this->_links[] = array('linkto' => $page_for_date); $td->setAttr('class', 'cal-day'); } if ($dbi->isWikiPage($page_for_date)) { - $this->_links[] = $page_for_date; + $this->_links[] = array('linkto' => $page_for_date); $date = HTML::a(array('class' => 'cal-day', 'href' => WikiURL($page_for_date), 'title' => $page_for_date), Modified: trunk/lib/plugin/CalendarList.php =================================================================== --- trunk/lib/plugin/CalendarList.php 2022-02-15 16:58:07 UTC (rev 11001) +++ trunk/lib/plugin/CalendarList.php 2022-02-15 18:23:37 UTC (rev 11002) @@ -140,7 +140,7 @@ array('action' => 'edit')), 'title' => sprintf(_("Edit %s"), $page_for_date)), $date_string); - $this->_links[] = $page_for_date; + $this->_links[] = array('linkto' => $page_for_date); $a = array(HTML::dt($link), HTML::dd($content)); } else { $a = array(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2022-03-24 13:28:36
|
Revision: 11008 http://sourceforge.net/p/phpwiki/code/11008 Author: vargenau Date: 2022-03-24 13:28:33 +0000 (Thu, 24 Mar 2022) Log Message: ----------- run php-cs-fixer Modified Paths: -------------- trunk/lib/plugin/AddComment.php trunk/lib/plugin/AllPages.php trunk/lib/plugin/AllUsers.php trunk/lib/plugin/AnalyseAccessLogSql.php trunk/lib/plugin/AppendText.php trunk/lib/plugin/AsciiMath.php trunk/lib/plugin/AsciiSVG.php trunk/lib/plugin/AtomFeed.php trunk/lib/plugin/AuthorHistory.php trunk/lib/plugin/BackLinks.php trunk/lib/plugin/BlogArchives.php trunk/lib/plugin/BlogJournal.php trunk/lib/plugin/BoxRight.php trunk/lib/plugin/CacheTest.php trunk/lib/plugin/Calendar.php trunk/lib/plugin/CalendarList.php trunk/lib/plugin/Chart.php trunk/lib/plugin/Comment.php trunk/lib/plugin/CreateBib.php trunk/lib/plugin/CreatePage.php trunk/lib/plugin/CreateToc.php trunk/lib/plugin/CurrentTime.php trunk/lib/plugin/DeadEndPages.php trunk/lib/plugin/DebugAuthInfo.php trunk/lib/plugin/DebugBackendInfo.php trunk/lib/plugin/DebugGroupInfo.php trunk/lib/plugin/DebugRetransform.php trunk/lib/plugin/Diff.php trunk/lib/plugin/DynamicIncludePage.php trunk/lib/plugin/EditMetaData.php trunk/lib/plugin/ExternalSearch.php trunk/lib/plugin/FacebookLike.php trunk/lib/plugin/FileInfo.php trunk/lib/plugin/FoafViewer.php trunk/lib/plugin/FullTextSearch.php trunk/lib/plugin/FuzzyPages.php trunk/lib/plugin/GoTo.php trunk/lib/plugin/GoogleMaps.php trunk/lib/plugin/GooglePlugin.php trunk/lib/plugin/GraphViz.php trunk/lib/plugin/HelloWorld.php trunk/lib/plugin/HtmlConverter.php trunk/lib/plugin/IncludePage.php trunk/lib/plugin/IncludePages.php trunk/lib/plugin/IncludeSiteMap.php trunk/lib/plugin/IncludeTree.php trunk/lib/plugin/InterWikiSearch.php trunk/lib/plugin/JabberPresence.php trunk/lib/plugin/LdapSearch.php trunk/lib/plugin/LikePages.php trunk/lib/plugin/LinkDatabase.php trunk/lib/plugin/LinkSearch.php trunk/lib/plugin/ListPages.php trunk/lib/plugin/ListRelations.php trunk/lib/plugin/ListSubpages.php trunk/lib/plugin/MediawikiTable.php trunk/lib/plugin/ModeratedPage.php trunk/lib/plugin/MostPopular.php trunk/lib/plugin/NewPagesPerUser.php trunk/lib/plugin/NoCache.php trunk/lib/plugin/OldStyleTable.php trunk/lib/plugin/OrphanedPages.php trunk/lib/plugin/PageDump.php trunk/lib/plugin/PageGroup.php trunk/lib/plugin/PageHistory.php trunk/lib/plugin/PageInfo.php trunk/lib/plugin/PageTrail.php trunk/lib/plugin/PasswordReset.php trunk/lib/plugin/PhotoAlbum.php trunk/lib/plugin/PhpHighlight.php trunk/lib/plugin/Ploticus.php trunk/lib/plugin/PluginManager.php trunk/lib/plugin/PopUp.php trunk/lib/plugin/PopularNearby.php trunk/lib/plugin/PopularTags.php trunk/lib/plugin/PreferenceApp.php trunk/lib/plugin/PrevNext.php trunk/lib/plugin/Processing.php trunk/lib/plugin/RandomPage.php trunk/lib/plugin/RateIt.php trunk/lib/plugin/RawHtml.php trunk/lib/plugin/RecentChanges.php trunk/lib/plugin/RecentComments.php trunk/lib/plugin/RecentEdits.php trunk/lib/plugin/RecentReferrers.php trunk/lib/plugin/RedirectTo.php trunk/lib/plugin/RelatedChanges.php trunk/lib/plugin/RichTable.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/SiteMap.php trunk/lib/plugin/SpellCheck.php trunk/lib/plugin/SqlResult.php trunk/lib/plugin/SyncWiki.php trunk/lib/plugin/SyntaxHighlighter.php trunk/lib/plugin/SystemInfo.php trunk/lib/plugin/TeX2png.php trunk/lib/plugin/Template.php trunk/lib/plugin/TexToPng.php trunk/lib/plugin/TitleSearch.php trunk/lib/plugin/Transclude.php trunk/lib/plugin/TranslateText.php trunk/lib/plugin/UnfoldSubpages.php trunk/lib/plugin/UpLoad.php trunk/lib/plugin/UriResolver.php trunk/lib/plugin/UserPreferences.php trunk/lib/plugin/UserRatings.php trunk/lib/plugin/Video.php trunk/lib/plugin/VisualWiki.php trunk/lib/plugin/WantedPages.php trunk/lib/plugin/WatchPage.php trunk/lib/plugin/WhoIsOnline.php trunk/lib/plugin/WikiAdminChown.php trunk/lib/plugin/WikiAdminDeleteAcl.php trunk/lib/plugin/WikiAdminPurge.php trunk/lib/plugin/WikiAdminRemove.php trunk/lib/plugin/WikiAdminRename.php trunk/lib/plugin/WikiAdminSearchReplace.php trunk/lib/plugin/WikiAdminSelect.php trunk/lib/plugin/WikiAdminSetAcl.php trunk/lib/plugin/WikiAdminSetAclSimple.php trunk/lib/plugin/WikiAdminSetExternal.php trunk/lib/plugin/WikiAdminUtils.php trunk/lib/plugin/WikiBlog.php trunk/lib/plugin/WikiForm.php trunk/lib/plugin/WikiFormRich.php trunk/lib/plugin/WikiForum.php trunk/lib/plugin/WikiPoll.php trunk/lib/plugin/WikiTranslation.php trunk/lib/plugin/WikicreoleTable.php trunk/lib/plugin/YouTube.php trunk/lib/plugin/text2png.php Modified: trunk/lib/plugin/AddComment.php =================================================================== --- trunk/lib/plugin/AddComment.php 2022-03-15 14:23:50 UTC (rev 11007) +++ trunk/lib/plugin/AddComment.php 2022-03-24 13:28:33 UTC (rev 11008) @@ -34,10 +34,9 @@ include_once 'lib/plugin/WikiBlog.php'; -class WikiPlugin_AddComment - extends WikiPlugin_WikiBlog +class WikiPlugin_AddComment extends WikiPlugin_WikiBlog { - function getDescription() + public function getDescription() { return sprintf(_("Show and add comments for %s."), '[pagename]'); } @@ -56,7 +55,7 @@ // jshide - boolean - quick javascript expansion of the comments // and addcomment box - function getDefaultArguments() + public function getDefaultArguments() { return array('pagename' => '[pagename]', 'order' => 'normal', @@ -74,7 +73,7 @@ * @param string $basepage * @return mixed */ - function run($dbi, $argstr, &$request, $basepage) + public function run($dbi, $argstr, &$request, $basepage) { $args = $this->getArgs($argstr, $request); if (!$args['pagename']) { @@ -128,17 +127,20 @@ a.title='" . _("Click to display all comments") . "'; } }")); - $html->pushContent(HTML::h4(HTML::a(array('id' => 'comment-header', + $html->pushContent(HTML::h4(HTML::a( + array('id' => 'comment-header', 'class' => 'wikiaction', 'title' => _("Click to display"), 'onclick' => "togglecomments(this)"), - _("Comments")))); + _("Comments") + ))); } else { $div = HTML::div(array('id' => 'comments')); } foreach (explode(',', $args['mode']) as $show) { - if (!empty($seen[$show])) + if (!empty($seen[$show])) { continue; + } $seen[$show] = 1; switch ($show) { case 'show': @@ -161,5 +163,4 @@ $html->pushContent($div); return $html; } - } Modified: trunk/lib/plugin/AllPages.php =================================================================== --- trunk/lib/plugin/AllPages.php 2022-03-15 14:23:50 UTC (rev 11007) +++ trunk/lib/plugin/AllPages.php 2022-03-24 13:28:33 UTC (rev 11008) @@ -30,18 +30,16 @@ * AllPagesCreatedByMe, AllPagesOwnedByMe, AllPagesLastAuthoredByMe */ -class WikiPlugin_AllPages - extends WikiPlugin +class WikiPlugin_AllPages extends WikiPlugin { - function getDescription() + public function getDescription() { return _("List all pages in this wiki."); } - function getDefaultArguments() + public function getDefaultArguments() { - return array_merge - ( + return array_merge( PageList::supportedArgs(), array( 'noheader' => false, @@ -48,7 +46,8 @@ 'include_empty' => false, 'info' => '', 'userpages' => false - )); + ) + ); } // info arg allows multiple columns @@ -63,7 +62,7 @@ * @param string $basepage * @return mixed */ - function run($dbi, $argstr, &$request, $basepage) + public function run($dbi, $argstr, &$request, $basepage) { $args = $this->getArgs($argstr, $request); @@ -101,8 +100,10 @@ } if (isset($args['limit']) && !is_limit($args['limit'])) { - return HTML::p(array('class' => "error"), - _("Illegal “limit” argument: must be an integer or two integers separated by comma")); + return HTML::p( + array('class' => "error"), + _("Illegal “limit” argument: must be an integer or two integers separated by comma") + ); } if (empty($args['sortby'])) { @@ -120,27 +121,42 @@ } elseif (!empty($args['owner'])) { $pages = PageList::allPagesByOwner($args['owner'], $include_empty, $args['sortby']); $args['count'] = count($pages); - $caption = fmt("List of pages owned by %s (%d total):", - WikiLink($args['owner'] == '[]' + $caption = fmt( + "List of pages owned by %s (%d total):", + WikiLink( + $args['owner'] == '[]' ? $request->_user->getAuthenticatedId() : $args['owner'], - 'if_known'), $args['count']); + 'if_known' + ), + $args['count'] + ); } elseif (!empty($args['author'])) { $pages = PageList::allPagesByAuthor($args['author'], $include_empty, $args['sortby']); $args['count'] = count($pages); - $caption = fmt("List of pages last edited by %s (%d total):", - WikiLink($args['author'] == '[]' + $caption = fmt( + "List of pages last edited by %s (%d total):", + WikiLink( + $args['author'] == '[]' ? $request->_user->getAuthenticatedId() : $args['author'], - 'if_known'), $args['count']); + 'if_known' + ), + $args['count'] + ); } elseif (!empty($args['creator'])) { $pages = PageList::allPagesByCreator($args['creator'], $include_empty, $args['sortby']); $args['count'] = count($pages); - $caption = fmt("List of pages created by %s (%d total):", - WikiLink($args['creator'] == '[]' + $caption = fmt( + "List of pages created by %s (%d total):", + WikiLink( + $args['creator'] == '[]' ? $request->_user->getAuthenticatedId() : $args['creator'], - 'if_known'), $args['count']); + 'if_known' + ), + $args['count'] + ); } elseif ($pages) { $args['count'] = count($pages); } else { Modified: trunk/lib/plugin/AllUsers.php =================================================================== --- trunk/lib/plugin/AllUsers.php 2022-03-15 14:23:50 UTC (rev 11007) +++ trunk/lib/plugin/AllUsers.php 2022-03-24 13:28:33 UTC (rev 11008) @@ -33,22 +33,21 @@ * externally authenticated users with a db users table, if auth_user_exists is defined. */ -class WikiPlugin_AllUsers - extends WikiPlugin +class WikiPlugin_AllUsers extends WikiPlugin { - function getDescription() + public function getDescription() { return _("List all once authenticated users."); } - function getDefaultArguments() + public function getDefaultArguments() { - return array_merge - ( + return array_merge( PageList::supportedArgs(), array('noheader' => false, 'include_empty' => true - )); + ) + ); } // info arg allows multiple columns @@ -67,13 +66,15 @@ * @param string $basepage * @return mixed */ - function run($dbi, $argstr, &$request, $basepage) + public function run($dbi, $argstr, &$request, $basepage) { $args = $this->getArgs($argstr, $request); if (isset($args['limit']) && !is_limit($args['limit'])) { - return HTML::p(array('class' => "error"), - _("Illegal “limit” argument: must be an integer or two integers separated by comma")); + return HTML::p( + array('class' => "error"), + _("Illegal “limit” argument: must be an integer or two integers separated by comma") + ); } extract($args); @@ -97,16 +98,20 @@ $args['count'] = count($allusers); // deleted pages show up as version 0. $pagelist = new PageList($info, $exclude, $args); - if (!$noheader) + if (!$noheader) { $pagelist->setCaption(_("Authenticated users on this wiki (%d total):")); - if ($include_empty and empty($info)) + } + if ($include_empty and empty($info)) { $pagelist->_addColumn('version'); + } list($offset, $pagesize) = $pagelist->limit($args['limit']); if (!$pagesize) { $pagelist->addPageList($allusers); } else { for ($i = $offset; $i < $offset + $pagesize - 1; $i++) { - if ($i >= $args['count']) break; + if ($i >= $args['count']) { + break; + } $pagelist->addPage(trim($allusers[$i])); } } Modified: trunk/lib/plugin/AnalyseAccessLogSql.php =================================================================== --- trunk/lib/plugin/AnalyseAccessLogSql.php 2022-03-15 14:23:50 UTC (rev 11007) +++ trunk/lib/plugin/AnalyseAccessLogSql.php 2022-03-24 13:28:33 UTC (rev 11008) @@ -30,8 +30,7 @@ * To add a new query, see getQueryString() */ -class WikiPlugin_AnalyseAccessLogSql - extends WikiPlugin +class WikiPlugin_AnalyseAccessLogSql extends WikiPlugin { public $_theadrow; public $_headerSet; @@ -88,8 +87,9 @@ } switch ($args['mode']) { case 'referring_urls': - if ($where_conditions <> '') + if ($where_conditions <> '') { $where_conditions = 'WHERE ' . $where_conditions . ' '; + } $query = "SELECT " . "$Referring_URL AS Referring_URL, " . "count(*) AS Referral_Count " @@ -100,8 +100,9 @@ case 'external_referers': $args['local_referrers'] = 'false'; $where_conditions = $this->getWhereConditions($args); - if ($where_conditions <> '') + if ($where_conditions <> '') { $where_conditions = 'WHERE ' . $where_conditions . ' '; + } $query = "SELECT " . "$Referring_URL AS Referring_URL, " . "count(*) AS Referral_Count " @@ -110,8 +111,9 @@ . "GROUP BY Referring_URL"; break; case 'referring_domains': - if ($where_conditions <> '') + if ($where_conditions <> '') { $where_conditions = 'WHERE ' . $where_conditions . ' '; + } switch ($backend_type) { case 'mysql': $Referring_Domain = "left(referer, if(locate('/', referer, 8) > 0,locate('/', referer, 8) -1, length(referer)))"; @@ -132,8 +134,9 @@ . "GROUP BY Referring_Domain"; break; case 'remote_hosts': - if ($where_conditions <> '') + if ($where_conditions <> '') { $where_conditions = 'WHERE ' . $where_conditions . ' '; + } $query = "SELECT " . "remote_host AS Remote_Host, " . "count(*) AS Access_Count " @@ -142,8 +145,9 @@ . "GROUP BY Remote_Host"; break; case 'users': - if ($where_conditions <> '') + if ($where_conditions <> '') { $where_conditions = 'WHERE ' . $where_conditions . ' '; + } $query = "SELECT " . "remote_user AS User, " . "count(*) AS Access_Count " @@ -152,8 +156,9 @@ . "GROUP BY remote_user"; break; case 'host_users': - if ($where_conditions <> '') + if ($where_conditions <> '') { $where_conditions = 'WHERE ' . $where_conditions . ' '; + } $query = "SELECT " . "remote_host AS Remote_Host, " . "remote_user AS User, " @@ -253,7 +258,7 @@ ); } - function getDefaultArguments() + public function getDefaultArguments() { return array( 'mode' => 'referring_domains', @@ -267,7 +272,7 @@ ); } - function getDescription() + public function getDescription() { return _("Show summary information from the access log table."); } @@ -279,19 +284,23 @@ * @param string $basepage * @return mixed */ - function run($dbi, $argstr, &$request, $basepage) + public function run($dbi, $argstr, &$request, $basepage) { // flag that the output may not be cached - i.e. it is dynamic $request->setArg('nocache', 1); if (!$request->_user->isAdmin()) { - return HTML::p(array('class' => 'error'), - _("The requested information is available only to Administrators.")); + return HTML::p( + array('class' => 'error'), + _("The requested information is available only to Administrators.") + ); } if (!ACCESS_LOG_SQL) { // need read access - return HTML::p(array('class' => 'error'), - _("The ACCESS_LOG_SQL is not enabled.")); + return HTML::p( + array('class' => 'error'), + _("The ACCESS_LOG_SQL is not enabled.") + ); } // set aside a place for the table headers, see setHeaders() @@ -303,8 +312,10 @@ $query = $this->getQueryString($args); if ($query == '') { - return HTML::p(array('class' => 'error'), - sprintf(_("Unrecognised parameter 'mode=%s'"), $args['mode'])); + return HTML::p( + array('class' => 'error'), + sprintf(_("Unrecognised parameter 'mode=%s'"), $args['mode']) + ); } // get the data back. @@ -312,10 +323,12 @@ // otherwise the headers will not be ready $tbody = $this->getQueryResults($query, $dbi); - return HTML::table(array('class' => 'bordered'), + return HTML::table( + array('class' => 'bordered'), HTML::caption($this->getCaption($args)), HTML::thead($this->_theadrow), - $tbody); + $tbody + ); } private function getQueryResults($query, &$dbi) @@ -366,8 +379,9 @@ } $since = $since * $args['count']; if ($since > 0) { - if ($where_conditions <> '') + if ($where_conditions <> '') { $where_conditions = $where_conditions . ' AND '; + } $since = time() - $since; $where_conditions = $where_conditions . "time_stamp > $since"; } @@ -375,8 +389,9 @@ if ($args['local_referrers'] <> 'true') { global $request; - if ($where_conditions <> '') + if ($where_conditions <> '') { $where_conditions = $where_conditions . ' AND '; + } $localhost = SERVER_URL; $len = strlen($localhost); $backend_type = $request->_dbi->_backend->backendType(); @@ -397,8 +412,9 @@ // The assumed contract is that there is a space at the end of the // conditions string, so that following SQL clauses (such as GROUP BY) // will not cause a syntax error - if ($where_conditions <> '') + if ($where_conditions <> '') { $where_conditions = $where_conditions . ' '; + } return $where_conditions; } @@ -406,11 +422,12 @@ private function getCaption(&$args) { $caption = $args['caption']; - if ($caption == '') + if ($caption == '') { $caption = gettext($args['mode']); - if ($args['period'] <> '' && $args['count']) + } + if ($args['period'] <> '' && $args['count']) { $caption = $caption . " - " . $args['count'] . " " . gettext($args['period']); + } return $caption; } - } Modified: trunk/lib/plugin/AppendText.php =================================================================== --- trunk/lib/plugin/AppendText.php 2022-03-15 14:23:50 UTC (rev 11007) +++ trunk/lib/plugin/AppendText.php 2022-03-24 13:28:33 UTC (rev 11008) @@ -33,15 +33,14 @@ * Todo: multiple pages. e.g. AppendText s=~[CategoryINtime~] page=<!plugin TitleSearch intime !> */ -class WikiPlugin_AppendText - extends WikiPlugin +class WikiPlugin_AppendText extends WikiPlugin { - function getDescription() + public function getDescription() { return _("Append text to any page in this wiki."); } - function getDefaultArguments() + public function getDefaultArguments() { return array('page' => '[pagename]', 'pages' => false, @@ -66,7 +65,7 @@ * @param string $basepage * @return HTML|XmlContent */ - function run($dbi, $argstr, &$request, $basepage) + public function run($dbi, $argstr, &$request, $basepage) { $args = $this->getArgs($argstr, $request); @@ -85,8 +84,9 @@ return $this->work($args['page'], $args, $dbi, $request); } else { $html = HTML(); - if ($args['page'] != $basepage) + if ($args['page'] != $basepage) { $html->pushContent(_("pages argument overrides page argument. ignored."), HTML::br()); + } foreach ($args['pages'] as $pagename) { $html->pushContent($this->work($pagename, $args, $dbi, $request)); } @@ -98,9 +98,10 @@ { if (empty($args['s'])) { if ($request->isPost()) { - if ($pagename != _("AppendText")) + if ($pagename != _("AppendText")) { $request->redirect(WikiURL($pagename, array(), 'absurl'), false); - return HTML(); + } + return HTML(); } return HTML(); } @@ -109,8 +110,10 @@ $message = HTML(); if (!$page->exists()) { // We might want to create it? - $message->pushContent(sprintf(_("Page could not be updated. %s doesn't exist!"), - $pagename)); + $message->pushContent(sprintf( + _("Page could not be updated. %s doesn't exist!"), + $pagename + )); return $message; } @@ -123,17 +126,21 @@ $before = preg_quote($args['before'], "/"); // Insert before $newtext = preg_match("/\n${before}/", $oldtext) - ? preg_replace("/(\n${before})/", + ? preg_replace( + "/(\n${before})/", "\n" . preg_quote($text, "/") . "\\1", - $oldtext) + $oldtext + ) : $this->fallback($text, $oldtext, $args['before'], $message); } elseif (!empty($args['after'])) { // Insert after $after = preg_quote($args['after'], "/"); $newtext = preg_match("/\n${after}/", $oldtext) - ? preg_replace("/(\n${after})/", + ? preg_replace( + "/(\n${after})/", "\\1\n" . preg_quote($text, "/"), - $oldtext) + $oldtext + ) : $this->fallback($text, $oldtext, $args['after'], $message); } else { // Append at the end @@ -145,8 +152,10 @@ $meta = $current->_data; $meta['summary'] = sprintf(_("AppendText to %s"), $pagename); if ($page->save($newtext, $current->getVersion() + 1, $meta)) { - $message->pushContent(HTML::p(array('class' => 'feedback'), - _("Page successfully updated."))); + $message->pushContent(HTML::p( + array('class' => 'feedback'), + _("Page successfully updated.") + )); } // AppendText has been called from the same page that got modified @@ -158,7 +167,7 @@ // $request->redirect(WikiURL($pagename, array(), 'absurl'), false); return HTML(); - // The user asked to be redirected to the modified page + // The user asked to be redirected to the modified page } elseif ($redirect) { $request->redirect(WikiURL($pagename, array(), 'absurl'), false); return HTML(); Modified: trunk/lib/plugin/AsciiMath.php =================================================================== --- trunk/lib/plugin/AsciiMath.php 2022-03-15 14:23:50 UTC (rev 11007) +++ trunk/lib/plugin/AsciiMath.php 2022-03-24 13:28:33 UTC (rev 11008) @@ -40,22 +40,21 @@ </math> */ -class WikiPlugin_AsciiMath - extends WikiPlugin +class WikiPlugin_AsciiMath extends WikiPlugin { public $source; - function getDescription() + public function getDescription() { return _("Render ASCII Math as MathML."); } - function getDefaultArguments() + public function getDefaultArguments() { return array(); } - function handle_plugin_args_cruft($argstr, $args) + public function handle_plugin_args_cruft($argstr, $args) { $this->source = $argstr; } @@ -67,7 +66,7 @@ * @param string $basepage * @return mixed */ - function run($dbi, $argstr, &$request, $basepage) + public function run($dbi, $argstr, &$request, $basepage) { $args = $this->getArgs($argstr, $request); if (empty($this->source)) { Modified: trunk/lib/plugin/AsciiSVG.php =================================================================== --- trunk/lib/plugin/AsciiSVG.php 2022-03-15 14:23:50 UTC (rev 11007) +++ trunk/lib/plugin/AsciiSVG.php 2022-03-24 13:28:33 UTC (rev 11008) @@ -27,17 +27,16 @@ * Syntax: http://www1.chapman.edu/~jipsen/svg/asciisvgcommands.html */ -class WikiPlugin_AsciiSVG - extends WikiPlugin +class WikiPlugin_AsciiSVG extends WikiPlugin { public $source; - function getDescription() + public function getDescription() { return _("Render inline ASCII SVG."); } - function getDefaultArguments() + public function getDefaultArguments() { return array('width' => 200, 'height' => 200, @@ -46,7 +45,7 @@ ); } - function handle_plugin_args_cruft($argstr, $args) + public function handle_plugin_args_cruft($argstr, $args) { $this->source = $argstr; } @@ -58,22 +57,24 @@ * @param string $basepage * @return mixed */ - function run($dbi, $argstr, &$request, $basepage) + public function run($dbi, $argstr, &$request, $basepage) { global $WikiTheme; $args = $this->getArgs($argstr, $request); if (empty($this->source)) { - return HTML::p(array('class' => "error"), - _("Please provide SVG code to AsciiSVG plugin")); + return HTML::p( + array('class' => "error"), + _("Please provide SVG code to AsciiSVG plugin") + ); } $html = HTML(); if (empty($WikiTheme->_asciiSVG)) { - $js = JavaScript('', array - ('src' => $WikiTheme->_findData('ASCIIsvg.js'))); - if (empty($WikiTheme->_headers_printed)) + $js = JavaScript('', array('src' => $WikiTheme->_findData('ASCIIsvg.js'))); + if (empty($WikiTheme->_headers_printed)) { $WikiTheme->addMoreHeaders($js); - else + } else { $html->pushContent($js); + } $WikiTheme->_asciiSVG = 1; // prevent duplicates } // extract <script> @@ -86,11 +87,15 @@ //'src' => "d.svg", 'script' => $this->source); // additional onmousemove argument - if ($args['onmousemove']) $embedargs['onmousemove'] = $args['onmousemove']; + if ($args['onmousemove']) { + $embedargs['onmousemove'] = $args['onmousemove']; + } // we need script='data' and not script="data" $embed = new AsciiSVG_HTML("embed", $embedargs); $html->pushContent($embed); - if ($args['script']) $html->pushContent(JavaScript($args['script'])); + if ($args['script']) { + $html->pushContent(JavaScript($args['script'])); + } return $html; } } @@ -97,22 +102,24 @@ class AsciiSVG_HTML extends HtmlElement { - function startTag() + public function startTag() { $start = "<" . $this->_tag; $this->_setClasses(); foreach ($this->_attr as $attr => $val) { if (is_bool($val)) { - if (!$val) + if (!$val) { continue; + } $val = $attr; } $qval = str_replace("\"", '"', $this->_quote((string)$val)); - if ($attr == 'script') + if ($attr == 'script') { // note the ' not " $start .= " $attr='$qval'"; - else + } else { $start .= " $attr=\"$qval\""; + } } $start .= ">"; return $start; Modified: trunk/lib/plugin/AtomFeed.php =================================================================== --- trunk/lib/plugin/AtomFeed.php 2022-03-15 14:23:50 UTC (rev 11007) +++ trunk/lib/plugin/AtomFeed.php 2022-03-24 13:28:33 UTC (rev 11008) @@ -29,15 +29,14 @@ require_once 'lib/WikiPlugin.php'; require_once 'lib/AtomParser.php'; -class WikiPlugin_AtomFeed - extends WikiPlugin +class WikiPlugin_AtomFeed extends WikiPlugin { - function getDescription() + public function getDescription() { return _('Atom Aggregator Plugin.'); } - function getDefaultArguments() + public function getDefaultArguments() { return array( 'feed' => "", @@ -55,7 +54,7 @@ * @param string $basepage * @return mixed */ - function run($dbi, $argstr, &$request, $basepage) + public function run($dbi, $argstr, &$request, $basepage) { extract($this->getArgs($argstr, $request)); Modified: trunk/lib/plugin/AuthorHistory.php =================================================================== --- trunk/lib/plugin/AuthorHistory.php 2022-03-15 14:23:50 UTC (rev 11007) +++ trunk/lib/plugin/AuthorHistory.php 2022-03-24 13:28:33 UTC (rev 11008) @@ -51,17 +51,16 @@ require_once 'lib/PageList.php'; -class WikiPlugin_AuthorHistory - extends WikiPlugin +class WikiPlugin_AuthorHistory extends WikiPlugin { public $_args; - function getDescription() + public function getDescription() { return _("List all page revisions edited by one user with diff links, or show a PageHistory-like list of a single page for only one user."); } - function getDefaultArguments() + public function getDefaultArguments() { global $request; return array('exclude' => '', @@ -85,7 +84,7 @@ * @param string $basepage * @return mixed */ - function run($dbi, $argstr, &$request, $basepage) + public function run($dbi, $argstr, &$request, $basepage) { $this->_args = $this->getArgs($argstr, $request); extract($this->_args); @@ -123,8 +122,9 @@ 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]!!!!! + if ($page && $page == 'username') { //FIXME: use [username]!!!!! $page = $author; + } $nbsp = HTML::raw(' '); @@ -137,8 +137,11 @@ if (!($page == 'all')) { $p = $dbi->getPage($page); - $thead->pushContent(HTML::tr(HTML::th(array('class' => 'align-right'), - _("Version")), + $thead->pushContent(HTML::tr( + HTML::th( + array('class' => 'align-right'), + _("Version") + ), $includeminor ? HTML::th(_("Minor")) : "", HTML::th(_("Author")), HTML::th(_("Summary")), @@ -147,22 +150,32 @@ $allrevisions_iter = $p->getAllRevisions(); while ($rev = $allrevisions_iter->next()) { - $isminor = $rev->get('is_minor_edit'); $authordoesmatch = $author == $rev->get('author'); if ($authordoesmatch && (!$isminor || ($includeminor && $isminor))) { - $difflink = Button(array('action' => 'diff', + $difflink = Button( + array('action' => 'diff', 'previous' => 'minor'), - $rev->getVersion(), $rev); - $tr = HTML::tr(HTML::td(array('class' => 'align-right'), - $difflink, $nbsp), + $rev->getVersion(), + $rev + ); + $tr = HTML::tr( + HTML::td( + array('class' => 'align-right'), + $difflink, + $nbsp + ), $includeminor ? (HTML::td($nbsp, ($isminor ? "minor" : "major"), $nbsp)) : "", - HTML::td($nbsp, WikiLink($rev->get('author'), - 'if_known'), $nbsp), + HTML::td($nbsp, WikiLink( + $rev->get('author'), + 'if_known' + ), $nbsp), HTML::td($nbsp, $rev->get('summary')), - HTML::td(array('class' => 'align-right'), - $WikiTheme->formatDateTime($rev->get('mtime'))) + HTML::td( + array('class' => 'align-right'), + $WikiTheme->formatDateTime($rev->get('mtime')) + ) ); $class = $isminor ? 'evenrow' : 'oddrow'; @@ -170,17 +183,22 @@ $tbody->pushContent($tr); } } - $captext = fmt($includeminor + $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')); + 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")), + $thead->pushContent(HTML::tr( + HTML::th(_("Page Name")), + HTML::th( + array('class' => 'align-right'), + _("Version") + ), $includeminor ? HTML::th(_("Minor")) : "", HTML::th(_("Summary")), HTML::th(_("Modified")) @@ -188,25 +206,34 @@ $allpages_iter = $dbi->getAllPages($includedeleted); while ($p = $allpages_iter->next()) { - $allrevisions_iter = $p->getAllRevisions(); while ($rev = $allrevisions_iter->next()) { $isminor = $rev->get('is_minor_edit'); $authordoesmatch = $author == $rev->get('author'); if ($authordoesmatch && (!$isminor || ($includeminor && $isminor))) { - $difflink = Button(array('action' => 'diff', + $difflink = Button( + array('action' => 'diff', 'previous' => 'minor'), - $rev->getVersion(), $rev); + $rev->getVersion(), + $rev + ); $tr = HTML::tr( - HTML::td($nbsp, + HTML::td( + $nbsp, ($isminor ? $rev->_pagename : WikiLink($rev->_pagename, 'auto')) ), - HTML::td(array('class' => 'align-right'), - $difflink, $nbsp), + HTML::td( + array('class' => 'align-right'), + $difflink, + $nbsp + ), $includeminor ? (HTML::td($nbsp, ($isminor ? "minor" : "major"), $nbsp)) : "", HTML::td($nbsp, $rev->get('summary')), - HTML::td(array('class' => 'align-right'), - $WikiTheme->formatDateTime($rev->get('mtime')), $nbsp) + HTML::td( + array('class' => 'align-right'), + $WikiTheme->formatDateTime($rev->get('mtime')), + $nbsp + ) ); $class = $isminor ? 'evenrow' : 'oddrow'; @@ -216,10 +243,12 @@ } } - $captext = fmt($includeminor + $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')); + WikiLink($author, 'auto') + ); } $table->pushContent(HTML::caption($captext)); Modified: trunk/lib/plugin/BackLinks.php =================================================================== --- trunk/lib/plugin/BackLinks.php 2022-03-15 14:23:50 UTC (rev 11007) +++ trunk/lib/plugin/BackLinks.php 2022-03-24 13:28:33 UTC (rev 11008) @@ -24,18 +24,16 @@ require_once 'lib/PageList.php'; -class WikiPlugin_BackLinks - extends WikiPlugin +class WikiPlugin_BackLinks extends WikiPlugin { - function getDescription() + public function getDescription() { return sprintf(_("List all pages which link to %s."), '[pagename]'); } - function getDefaultArguments() + public function getDefaultArguments() { - return array_merge - ( + return array_merge( PageList::supportedArgs(), array('include_self' => false, 'noheader' => false, @@ -42,7 +40,8 @@ 'page' => '[pagename]', 'linkmore' => '', // If count>0 and limit>0 display a link with // the number of all results, linked to the given pagename. - )); + ) + ); } // info arg allows multiple columns @@ -57,13 +56,15 @@ * @param string $basepage * @return mixed */ - function run($dbi, $argstr, &$request, $basepage) + public function run($dbi, $argstr, &$request, $basepage) { $args = $this->getArgs($argstr, $request); if (isset($args['limit']) && !is_limit($args['limit'])) { - return HTML::p(array('class' => "error"), - _("Illegal “limit” argument: must be an integer or two integers separated by comma")); + return HTML::p( + array('class' => "error"), + _("Illegal “limit” argument: must be an integer or two integers separated by comma") + ); } extract($args); @@ -122,15 +123,18 @@ $bi = $dp->getBackLinks(false, $sortby, 0, $exclude); while ($b = $bi->next()) { $name = $b->getName(); - if (isset($bl[$name])) + if (isset($bl[$name])) { $bl[$name]++; - else + } else { $bl[$name] = 1; + } } } - foreach ($bl as $b => $v) - if ($v == $count) + foreach ($bl as $b => $v) { + if ($v == $count) { $pagelist->addPage($b); + } + } } else { $p = $dbi->getPage($page); $pagelist->addPages($p->getBackLinks(false, $sortby, 0, $exclude)); @@ -156,12 +160,16 @@ // page currently being viewed. $pagelink = $page; - if ($pagelist->isEmpty()) + if ($pagelist->isEmpty()) { return HTML::p(fmt("No other page links to %s yet.", $pagelink)); + } - if ($total == 1) - $pagelist->setCaption(fmt("One page would link to %s:", - $pagelink)); + if ($total == 1) { + $pagelist->setCaption(fmt( + "One page would link to %s:", + $pagelink + )); + } // Some future localizations will actually require // this... (BelieveItOrNot, English-only-speakers!(:) // @@ -168,28 +176,38 @@ // else if ($pagelist->getTotal() == 2) // $pagelist->setCaption(fmt("Two pages would link to %s:", // $pagelink)); - else - $pagelist->setCaption(fmt("%s pages would link to %s:", - $total, $pagelink)); + else { + $pagelist->setCaption(fmt( + "%s pages would link to %s:", + $total, + $pagelink + )); + } } else { if ($count) { $tmp_pages = $pages; $p = array_shift($tmp_pages); $pagelink = HTML(WikiLink($p, 'auto')); - foreach ($tmp_pages as $p) + foreach ($tmp_pages as $p) { $pagelink->pushContent(" ", _("AND"), " ", WikiLink($p, 'auto')); - } else + } + } else { // BackLinks plugin is being displayed on a normal page. $pagelink = WikiLink($page, 'auto'); + } - if ($pagelist->isEmpty()) + if ($pagelist->isEmpty()) { return HTML::p(fmt("No page links to %s.", $pagelink)); + } //trigger_error("DEBUG: " . $pagelist->getTotal()); - if ($total == 1) - $pagelist->setCaption(fmt("One page links to %s:", - $pagelink)); + if ($total == 1) { + $pagelist->setCaption(fmt( + "One page links to %s:", + $pagelink + )); + } // Some future localizations will actually require // this... (BelieveItOrNot, English-only-speakers!(:) // @@ -196,26 +214,29 @@ // else if ($pagelist->getTotal() == 2) // $pagelist->setCaption(fmt("Two pages link to %s:", // $pagelink)); - else - $pagelist->setCaption(fmt("%s pages link to %s:", + else { + $pagelist->setCaption(fmt( + "%s pages link to %s:", $limit > 0 ? $total : _("Those"), - $pagelink)); + $pagelink + )); + } } } if (!empty($args['linkmore']) and $dbi->isWikiPage($args['linkmore']) and $limit > 0 and $total > $limit - ) + ) { $pagelist->addCaption(WikiLink($args['linkmore'], "auto", _("More..."))); + } return $pagelist; } - } // how many links from this backLink to other pages class _PageList_Column_BackLinks_count extends _PageList_Column { - function _getValue($page_handle, $revision_handle) + public function _getValue($page_handle, $revision_handle) { $iter = $page_handle->getPageLinks(); return $iter->count(); Modified: trunk/lib/plugin/BlogArchives.php =================================================================== --- trunk/lib/plugin/BlogArchives.php 2022-03-15 14:23:50 UTC (rev 11007) +++ trunk/lib/plugin/BlogArchives.php 2022-03-24 13:28:33 UTC (rev 11008) @@ -35,15 +35,14 @@ * @author: Reini Urban */ -class WikiPlugin_BlogArchives - extends WikiPlugin_WikiBlog +class WikiPlugin_BlogArchives extends WikiPlugin_WikiBlog { - function getDescription() + public function getDescription() { return _("List blog months links for the current or ADMIN user."); } - function getDefaultArguments() + public function getDefaultArguments() { return //array_merge //( @@ -63,11 +62,13 @@ * @param string $basepage * @return mixed */ - function run($dbi, $argstr, &$request, $basepage) + public function run($dbi, $argstr, &$request, $basepage) { if (is_array($argstr)) { // can do with array also. $args =& $argstr; - if (!isset($args['order'])) $args['order'] = 'reverse'; + if (!isset($args['order'])) { + $args['order'] = 'reverse'; + } } else { $args = $this->getArgs($argstr, $request); } @@ -80,10 +81,12 @@ } } if (!$args['user'] or $args['user'] == ADMIN_USER) { - if (BLOG_DEFAULT_EMPTY_PREFIX) - $args['user'] = ''; // "Blogs/day" pages - else - $args['user'] = ADMIN_USER; // "Admin/Blogs/day" pages + if (BLOG_DEFAULT_EMPTY_PREFIX) { + $args['user'] = ''; + } // "Blogs/day" pages + else { + $args['user'] = ADMIN_USER; + } // "Admin/Blogs/day" pages } $parent = (empty($args['user']) ? '' : $args['user'] . '/'); @@ -98,50 +101,65 @@ $html = HTML::ul(); while ($page = $pages->next()) { $rev = $page->getCurrentRevision(false); - if ($rev->get('pagetype') != 'wikiblog') continue; + if ($rev->get('pagetype') != 'wikiblog') { + continue; + } $blog = $this->_blog($rev); $html->pushContent(HTML::li(WikiLink($page, 'known', $rev->get('summary')))); } - if (!$args['noheader']) - return HTML(HTML::h3(sprintf(_("Blog Entries for %s:"), $this->monthTitle($args['month']))), - $html); - else + if (!$args['noheader']) { + return HTML( + HTML::h3(sprintf(_("Blog Entries for %s:"), $this->monthTitle($args['month']))), + $html + ); + } else { return $html; + } } $blogs = $this->findBlogs($dbi, $args['user']); if ($blogs) { - if (!$basepage) $basepage = _("BlogArchives"); + if (!$basepage) { + $basepage = _("BlogArchives"); + } $html = HTML::ul(); usort($blogs, array("WikiPlugin_WikiBlog", "cmp")); - if ($args['order'] == 'reverse') + if ($args['order'] == 'reverse') { $blogs = array_reverse($blogs); + } // collapse pagenames by month $months = array(); foreach ($blogs as $rev) { $blog = $this->_blog($rev); $mon = $blog['month']; - if (empty($months[$mon])) + if (empty($months[$mon])) { $months[$mon] = array('title' => $this->monthTitle($mon), 'num' => 1, 'month' => $mon, - 'link' => WikiURL($basepage, - $this->nonDefaultArgs(array('month' => $mon)))); - else + 'link' => WikiURL( + $basepage, + $this->nonDefaultArgs(array('month' => $mon)) + )); + } else { $months[$mon]['num']++; + } } foreach ($months as $m) { - $html->pushContent(HTML::li(HTML::a(array('href' => $m['link'], + $html->pushContent(HTML::li(HTML::a( + array('href' => $m['link'], 'class' => 'named-wiki'), - $m['title'] . " (" . $m['num'] . ")"))); + $m['title'] . " (" . $m['num'] . ")" + ))); } - if (!$args['noheader']) + if (!$args['noheader']) { return HTML(HTML::h3(_("Blog Archives:")), $html); - else + } else { return $html; - } else + } + } else { return ''; + } } // box is used to display a fixed-width, narrow version with common header @@ -151,10 +169,14 @@ * @param string $basepage * @return $this|HtmlElement */ - function box($args = '', $request = null, $basepage = '') + public function box($args = '', $request = null, $basepage = '') { - if (!$request) $request =& $GLOBALS['request']; - if (!$args or empty($args['limit'])) $args['limit'] = 10; + if (!$request) { + $request =& $GLOBALS['request']; + } + if (!$args or empty($args['limit'])) { + $args['limit'] = 10; + } $args['noheader'] = 1; return $this->makeBox(_("Archives"), $this->run($request->_dbi, $args, $request, $basepage)); } Modified: trunk/lib/plugin/BlogJournal.php =================================================================== --- trunk/lib/plugin/BlogJournal.php 2022-03-15 14:23:50 UTC (rev 11007) +++ trunk/lib/plugin/BlogJournal.php 2022-03-24 13:28:33 UTC (rev 11008) @@ -34,15 +34,14 @@ * @author: Reini Urban */ -class WikiPlugin_BlogJournal - extends WikiPlugin_WikiBlog +class WikiPlugin_BlogJournal extends WikiPlugin_WikiBlog { - function getDescription() + public function getDescription() { return _("Include latest blog entries for the current or ADMIN user."); } - function getDefaultArguments() + public function getDefaultArguments() { return array('count' => 7, 'user' => '', @@ -59,11 +58,13 @@ * @param string $basepage * @return mixed */ - function run($dbi, $argstr, &$request, $basepage) + public function run($dbi, $argstr, &$request, $basepage) { if (is_array($argstr)) { // can do with array also. $args =& $argstr; - if (!isset($args['order'])) $args['order'] = 'reverse'; + if (!isset($args['order'])) { + $args['order'] = 'reverse'; + } } else { $args = $this->getArgs($argstr, $request); } @@ -85,29 +86,40 @@ $parent = (empty($args['user']) ? '' : $args['user'] . '/'); $prefix = $base = $parent . $this->blogPrefix(); - if ($args['month']) + if ($args['month']) { $prefix .= ('/' . $args['month']); + } $pages = $dbi->titleSearch(new TextSearchQuery("^" . $prefix . '/', true, 'posix')); $html = HTML(); $i = 0; while (($page = $pages->next()) and $i < $args['count']) { $rev = $page->getCurrentRevision(false); - if ($rev->get('pagetype') != 'wikiblog') continue; + if ($rev->get('pagetype') != 'wikiblog') { + continue; + } $i++; $blog = $this->_blog($rev); //$html->pushContent(HTML::h3(WikiLink($page, 'known', $rev->get('summary')))); $html->pushContent($rev->getTransformedContent('wikiblog')); } - if ($args['user'] == $user->UserName() or $args['user'] == '') - $html->pushContent(Button(array('action' => 'WikiBlog', + if ($args['user'] == $user->UserName() or $args['user'] == '') { + $html->pushContent(Button( + array('action' => 'WikiBlog', 'mode' => 'add'), - _("New entry"), $base)); - if (!$i) + _("New entry"), + $base + )); + } + if (!$i) { return HTML(HTML::h3(_("No Blog Entries")), $html); - if (!$args['noheader']) - return HTML(HTML::h3(sprintf(_("Blog Entries for %s:"), $this->monthTitle($args['month']))), - $html); - else + } + if (!$args['noheader']) { + return HTML( + HTML::h3(sprintf(_("Blog Entries for %s:"), $this->monthTitle($args['month']))), + $html + ); + } else { return $html; + } } } Modified: trunk/lib/plugin/BoxRight.php =================================================================== --- trunk/lib/plugin/BoxRight.php 2022-03-15 14:23:50 UTC (rev 11007) +++ trunk/lib/plugin/BoxRight.php 2022-03-24 13:28:33 UTC (rev 11008) @@ -26,20 +26,19 @@ * A simple plugin for <div class="boxright"> with wikimarkup */ -class WikiPlugin_BoxRight - extends WikiPlugin +class WikiPlugin_BoxRight extends WikiPlugin { - function getDescription() + public function getDescription() { return _("A simple plugin for <div class=boxright> with wikimarkup."); } - function getDefaultArguments() + public function getDefaultArguments() { return array(); } - function managesValidators() + public function managesValidators() { // The plugin output will only change if the plugin // invocation (page text) changes --- so the necessary @@ -54,7 +53,7 @@ * @param string $basepage * @return mixed */ - function run($dbi, $argstr, &$request, $basepage) + public function run($dbi, $argstr, &$request, $basepage) { if (!$basepage) { return $this->error("$basepage unset?"); @@ -63,5 +62,4 @@ $page = $request->getPage($basepage); return HTML::div(array('class' => 'boxright'), TransformText($argstr)); } - } Modified: trunk/lib/plugin/CacheTest.php =================================================================== --- trunk/lib/plugin/CacheTest.php 2022-03-15 14:23:50 UTC (rev 11007) +++ trunk/lib/plugin/CacheTest.php 2022-03-24 13:28:33 UTC (rev 11008) @@ -38,22 +38,21 @@ require_once 'lib/WikiPluginCached.php'; -class WikiPlugin_CacheTest - extends WikiPluginCached +class WikiPlugin_CacheTest extends WikiPluginCached { /* --------- overwrite abstract methods ---------------- */ - function getPluginType() + public function getPluginType() { return PLUGIN_CACHED_IMG_ONDEMAND; } - function getDescription() + public function getDescription() { return _('This is a simple example using WikiPluginCached.'); } - function getDefaultArguments() + public function getDefaultArguments() { return array('text' => $this->getDescription(), 'font' => '3', @@ -86,7 +85,7 @@ trigger_error('pure virtual', E_USER_ERROR); } - function getImageType($dbi, $argarray, $request) + public function getImageType($dbi, $argarray, $request) { extract($argarray); if (in_array($type, array('png', 'gif', 'jpg'))) { @@ -95,7 +94,7 @@ return 'png'; } - function getAlt($dbi, $argarray, $request) + public function getAlt($dbi, $argarray, $request) { // ALT-text for <img> tag extract($argarray); @@ -102,7 +101,7 @@ return $text; } - function getExpire($dbi, $argarray, $request) + public function getExpire($dbi, $argarray, $request) { return '+600'; // 600 seconds life time } @@ -109,7 +108,7 @@ /* -------------------- extremely simple converter -------------------- */ - function produceGraphics($text, $font) + public function produceGraphics($text, $font) { // The idea (and some code) is stolen from the text2png plugin // but I did not want to use TTF. Imagestring is quite ugly @@ -148,17 +147,19 @@ // we could have used the simple built-in text2img function // instead of writing our own: - function lazy_produceGraphics($text, $font) + public function lazy_produceGraphics($text, $font) { if ($font < 1 || $font > 5) { $text = "Fontnr. (font=\"$font\") should be in range 1-5"; $this->complain($text); $font = 3; - } - return $this->text2img($text, $font, array(0, 0, 0), - array(255, 255, 255)); + return $this->text2img( + $text, + $font, + array(0, 0, 0), + array(255, 255, 255) + ); } // lazy_produceGraphics - } Modified: trunk/lib/plugin/Calendar.php =================================================================== --- trunk/lib/plugin/Calendar.php 2022-03-15 14:23:50 UTC (rev 11007) +++ trunk/lib/plugin/Calendar.php 2022-03-24 13:28:33 UTC (rev 11008) @@ -22,8 +22,9 @@ * */ -if (!defined('SECONDS_PER_DAY')) +if (!defined('SECONDS_PER_DAY')) { define('SECONDS_PER_DAY', 24 * 3600); +} // FIXME: Still needs: // @@ -34,19 +35,18 @@ // pages back to the calendar page. (Subpage support might make this // easier.) -class WikiPlugin_Calendar - extends WikiPlugin +class WikiPlugin_Calendar ex... [truncated message content] |
From: <var...@us...> - 2023-07-14 09:19:37
|
Revision: 11048 http://sourceforge.net/p/phpwiki/code/11048 Author: vargenau Date: 2023-07-14 09:19:32 +0000 (Fri, 14 Jul 2023) Log Message: ----------- plugin: PHP 7: add types for function arguments and return Modified Paths: -------------- trunk/lib/plugin/AddComment.php trunk/lib/plugin/AllPages.php trunk/lib/plugin/AllUsers.php trunk/lib/plugin/AnalyseAccessLogSql.php trunk/lib/plugin/AppendText.php trunk/lib/plugin/AsciiMath.php trunk/lib/plugin/AsciiSVG.php trunk/lib/plugin/AtomFeed.php trunk/lib/plugin/AuthorHistory.php trunk/lib/plugin/BackLinks.php trunk/lib/plugin/BlogArchives.php trunk/lib/plugin/BlogJournal.php trunk/lib/plugin/BoxRight.php trunk/lib/plugin/CacheTest.php trunk/lib/plugin/Calendar.php trunk/lib/plugin/CalendarList.php trunk/lib/plugin/Chart.php trunk/lib/plugin/Comment.php trunk/lib/plugin/CreateBib.php trunk/lib/plugin/CreatePage.php trunk/lib/plugin/CreateToc.php trunk/lib/plugin/CurrentTime.php trunk/lib/plugin/DebugAuthInfo.php trunk/lib/plugin/DebugBackendInfo.php trunk/lib/plugin/DebugGroupInfo.php trunk/lib/plugin/DebugRetransform.php trunk/lib/plugin/Diff.php trunk/lib/plugin/DynamicIncludePage.php trunk/lib/plugin/EditMetaData.php trunk/lib/plugin/ExternalSearch.php trunk/lib/plugin/FacebookLike.php trunk/lib/plugin/FileInfo.php trunk/lib/plugin/FoafViewer.php trunk/lib/plugin/FullTextSearch.php trunk/lib/plugin/FuzzyPages.php trunk/lib/plugin/GoTo.php trunk/lib/plugin/GoogleMaps.php trunk/lib/plugin/GooglePlugin.php trunk/lib/plugin/GraphViz.php trunk/lib/plugin/HelloWorld.php trunk/lib/plugin/HtmlConverter.php trunk/lib/plugin/IncludePage.php trunk/lib/plugin/IncludePages.php trunk/lib/plugin/IncludeSiteMap.php trunk/lib/plugin/IncludeTree.php trunk/lib/plugin/InterWikiSearch.php trunk/lib/plugin/JabberPresence.php trunk/lib/plugin/LdapSearch.php trunk/lib/plugin/LikePages.php trunk/lib/plugin/LinkDatabase.php trunk/lib/plugin/LinkSearch.php trunk/lib/plugin/ListPages.php trunk/lib/plugin/ListRelations.php trunk/lib/plugin/ListSubpages.php trunk/lib/plugin/MediawikiTable.php trunk/lib/plugin/ModeratedPage.php trunk/lib/plugin/MostPopular.php trunk/lib/plugin/NewPagesPerUser.php trunk/lib/plugin/NoCache.php trunk/lib/plugin/OldStyleTable.php trunk/lib/plugin/OrphanedPages.php trunk/lib/plugin/PageDump.php trunk/lib/plugin/PageGroup.php trunk/lib/plugin/PageHistory.php trunk/lib/plugin/PageInfo.php trunk/lib/plugin/PageTrail.php trunk/lib/plugin/PasswordReset.php trunk/lib/plugin/PhotoAlbum.php trunk/lib/plugin/PhpHighlight.php trunk/lib/plugin/Ploticus.php trunk/lib/plugin/PluginManager.php trunk/lib/plugin/PopUp.php trunk/lib/plugin/PopularNearby.php trunk/lib/plugin/PopularTags.php trunk/lib/plugin/PreferenceApp.php trunk/lib/plugin/PrevNext.php trunk/lib/plugin/Processing.php trunk/lib/plugin/RandomPage.php trunk/lib/plugin/RateIt.php trunk/lib/plugin/RawHtml.php trunk/lib/plugin/RecentChanges.php trunk/lib/plugin/RecentComments.php trunk/lib/plugin/RecentEdits.php trunk/lib/plugin/RecentReferrers.php trunk/lib/plugin/RedirectTo.php trunk/lib/plugin/RelatedChanges.php trunk/lib/plugin/RichTable.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/SiteMap.php trunk/lib/plugin/SpellCheck.php trunk/lib/plugin/SqlResult.php trunk/lib/plugin/SyncWiki.php trunk/lib/plugin/SyntaxHighlighter.php trunk/lib/plugin/SystemInfo.php trunk/lib/plugin/TeX2png.php trunk/lib/plugin/Template.php trunk/lib/plugin/TexToPng.php trunk/lib/plugin/TitleSearch.php trunk/lib/plugin/Transclude.php trunk/lib/plugin/TranslateText.php trunk/lib/plugin/UnfoldSubpages.php trunk/lib/plugin/UpLoad.php trunk/lib/plugin/UriResolver.php trunk/lib/plugin/UserPreferences.php trunk/lib/plugin/UserRatings.php trunk/lib/plugin/Video.php trunk/lib/plugin/WantedPages.php trunk/lib/plugin/WatchPage.php trunk/lib/plugin/WhoIsOnline.php trunk/lib/plugin/WikiAdminChown.php trunk/lib/plugin/WikiAdminDeleteAcl.php trunk/lib/plugin/WikiAdminPurge.php trunk/lib/plugin/WikiAdminRemove.php trunk/lib/plugin/WikiAdminRename.php trunk/lib/plugin/WikiAdminSearchReplace.php trunk/lib/plugin/WikiAdminSelect.php trunk/lib/plugin/WikiAdminSetAcl.php trunk/lib/plugin/WikiAdminSetAclSimple.php trunk/lib/plugin/WikiAdminSetExternal.php trunk/lib/plugin/WikiAdminUtils.php trunk/lib/plugin/WikiBlog.php trunk/lib/plugin/WikiForm.php trunk/lib/plugin/WikiFormRich.php trunk/lib/plugin/WikiForum.php trunk/lib/plugin/WikiPoll.php trunk/lib/plugin/WikiTranslation.php trunk/lib/plugin/WikicreoleTable.php trunk/lib/plugin/YouTube.php trunk/lib/plugin/text2png.php Modified: trunk/lib/plugin/AddComment.php =================================================================== --- trunk/lib/plugin/AddComment.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/AddComment.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -36,7 +36,7 @@ class WikiPlugin_AddComment extends WikiPlugin_WikiBlog { - public function getDescription() + public function getDescription(): string { return sprintf(_("Show and add comments for %s."), '[pagename]'); } @@ -55,7 +55,7 @@ // jshide - boolean - quick javascript expansion of the comments // and addcomment box - public function getDefaultArguments() + public function getDefaultArguments(): array { return array('pagename' => '[pagename]', 'order' => 'normal', Modified: trunk/lib/plugin/AllPages.php =================================================================== --- trunk/lib/plugin/AllPages.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/AllPages.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -32,12 +32,12 @@ class WikiPlugin_AllPages extends WikiPlugin { - public function getDescription() + public function getDescription(): string { return _("List all pages in this wiki."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array_merge( PageList::supportedArgs(), Modified: trunk/lib/plugin/AllUsers.php =================================================================== --- trunk/lib/plugin/AllUsers.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/AllUsers.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -35,12 +35,12 @@ class WikiPlugin_AllUsers extends WikiPlugin { - public function getDescription() + public function getDescription(): string { return _("List all once authenticated users."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array_merge( PageList::supportedArgs(), Modified: trunk/lib/plugin/AnalyseAccessLogSql.php =================================================================== --- trunk/lib/plugin/AnalyseAccessLogSql.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/AnalyseAccessLogSql.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -61,7 +61,7 @@ * @param array $args * @return string */ - private function getQueryString(&$args) + private function getQueryString(array &$args): string { // extract any parametrised conditions from the arguments, // in particular, how much history to select @@ -258,7 +258,7 @@ ); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array( 'mode' => 'referring_domains', @@ -272,7 +272,7 @@ ); } - public function getDescription() + public function getDescription(): string { return _("Show summary information from the access log table."); } @@ -362,7 +362,7 @@ } } - private function getWhereConditions(&$args) + private function getWhereConditions(&$args): string { $where_conditions = ''; Modified: trunk/lib/plugin/AppendText.php =================================================================== --- trunk/lib/plugin/AppendText.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/AppendText.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -35,12 +35,12 @@ class WikiPlugin_AppendText extends WikiPlugin { - public function getDescription() + public function getDescription(): string { return _("Append text to any page in this wiki."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array('page' => '[pagename]', 'pages' => false, @@ -51,7 +51,7 @@ ); } - private function fallback($addtext, $oldtext, $notfound, $message) + private function fallback($addtext, $oldtext, $notfound, $message): string { $message->pushContent(sprintf(_("“%s” not found"), $notfound) . ". " . _("Appending at the end.") . "\n"); Modified: trunk/lib/plugin/AsciiMath.php =================================================================== --- trunk/lib/plugin/AsciiMath.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/AsciiMath.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -44,12 +44,12 @@ { public $source; - public function getDescription() + public function getDescription(): string { return _("Render ASCII Math as MathML."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array(); } Modified: trunk/lib/plugin/AsciiSVG.php =================================================================== --- trunk/lib/plugin/AsciiSVG.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/AsciiSVG.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -31,12 +31,12 @@ { public $source; - public function getDescription() + public function getDescription(): string { return _("Render inline ASCII SVG."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array('width' => 200, 'height' => 200, @@ -102,7 +102,7 @@ class AsciiSVG_HTML extends HtmlElement { - public function startTag() + public function startTag(): string { $start = "<" . $this->_tag; $this->_setClasses(); Modified: trunk/lib/plugin/AtomFeed.php =================================================================== --- trunk/lib/plugin/AtomFeed.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/AtomFeed.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -31,12 +31,12 @@ class WikiPlugin_AtomFeed extends WikiPlugin { - public function getDescription() + public function getDescription(): string { return _('Atom Aggregator Plugin.'); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array( 'feed' => "", Modified: trunk/lib/plugin/AuthorHistory.php =================================================================== --- trunk/lib/plugin/AuthorHistory.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/AuthorHistory.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -55,12 +55,12 @@ { public $_args; - public function getDescription() + public function getDescription(): string { return _("List all page revisions edited by one user with diff links, or show a PageHistory-like list of a single page for only one user."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { global $request; return array('exclude' => '', Modified: trunk/lib/plugin/BackLinks.php =================================================================== --- trunk/lib/plugin/BackLinks.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/BackLinks.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -26,12 +26,12 @@ class WikiPlugin_BackLinks extends WikiPlugin { - public function getDescription() + public function getDescription(): string { return sprintf(_("List all pages which link to %s."), '[pagename]'); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array_merge( PageList::supportedArgs(), Modified: trunk/lib/plugin/BlogArchives.php =================================================================== --- trunk/lib/plugin/BlogArchives.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/BlogArchives.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -37,12 +37,12 @@ class WikiPlugin_BlogArchives extends WikiPlugin_WikiBlog { - public function getDescription() + public function getDescription(): string { return _("List blog months links for the current or ADMIN user."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return //array_merge //( Modified: trunk/lib/plugin/BlogJournal.php =================================================================== --- trunk/lib/plugin/BlogJournal.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/BlogJournal.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -36,12 +36,12 @@ class WikiPlugin_BlogJournal extends WikiPlugin_WikiBlog { - public function getDescription() + public function getDescription(): string { return _("Include latest blog entries for the current or ADMIN user."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array('count' => 7, 'user' => '', Modified: trunk/lib/plugin/BoxRight.php =================================================================== --- trunk/lib/plugin/BoxRight.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/BoxRight.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -28,17 +28,17 @@ class WikiPlugin_BoxRight extends WikiPlugin { - public function getDescription() + public function getDescription(): string { return _("A simple plugin for <div class=boxright> with wikimarkup."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array(); } - public function managesValidators() + public function managesValidators(): bool { // The plugin output will only change if the plugin // invocation (page text) changes --- so the necessary Modified: trunk/lib/plugin/CacheTest.php =================================================================== --- trunk/lib/plugin/CacheTest.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/CacheTest.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -42,7 +42,7 @@ { /* --------- overwrite abstract methods ---------------- */ - public function getPluginType() + public function getPluginType(): int { return PLUGIN_CACHED_IMG_ONDEMAND; } @@ -52,7 +52,7 @@ return _('This is a simple example using WikiPluginCached.'); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array('text' => $this->getDescription(), 'font' => '3', @@ -101,7 +101,7 @@ return $text; } - public function getExpire($dbi, $argarray, $request) + public function getExpire($dbi, $argarray, $request): string { return '+600'; // 600 seconds life time } @@ -147,7 +147,7 @@ // we could have used the simple built-in text2img function // instead of writing our own: - public function lazy_produceGraphics($text, $font) + public function lazy_produceGraphics($text, $font): string { if ($font < 1 || $font > 5) { $text = "Fontnr. (font=\"$font\") should be in range 1-5"; Modified: trunk/lib/plugin/Calendar.php =================================================================== --- trunk/lib/plugin/Calendar.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/Calendar.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -41,12 +41,12 @@ private $_today; public $_links; - public function getDescription() + public function getDescription(): string { return _("Calendar"); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array('prefix' => '[pagename]' . '/', 'date_format' => '%Y-%m-%d', @@ -66,7 +66,7 @@ * @param string $basepage The pagename the plugin is invoked from. * @return array List of pagenames linked to (or false). */ - public function getWikiPageLinks($argstr, $basepage) + public function getWikiPageLinks($argstr, $basepage): array { if (isset($this->_links)) { return $this->_links; Modified: trunk/lib/plugin/CalendarList.php =================================================================== --- trunk/lib/plugin/CalendarList.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/CalendarList.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -59,12 +59,12 @@ public $args; public $_links; - public function getDescription() + public function getDescription(): string { return _("CalendarList"); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array('prefix' => '[pagename]', 'date_format' => '%Y-%m-%d', @@ -91,7 +91,7 @@ * @param string $basepage The pagename the plugin is invoked from. * @return array List of pagenames linked to (or false). */ - public function getWikiPageLinks($argstr, $basepage) + public function getWikiPageLinks($argstr, $basepage): array { if (isset($this->_links)) { return $this->_links; @@ -127,7 +127,7 @@ return $timeTMP; } - private function _date($dbi, $time) + private function _date($dbi, $time): array { $args = &$this->args; $date_string = strftime($args['date_format'], $time); Modified: trunk/lib/plugin/Chart.php =================================================================== --- trunk/lib/plugin/Chart.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/Chart.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -49,12 +49,12 @@ { public $source; - public function getDescription() + public function getDescription(): string { return _("Render SVG charts."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array('width' => 200, 'height' => 200, @@ -163,7 +163,7 @@ class SVG_HTML extends HtmlElement { - public function startTag() + public function startTag(): string { $start = "<" . $this->_tag; $this->_setClasses(); Modified: trunk/lib/plugin/Comment.php =================================================================== --- trunk/lib/plugin/Comment.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/Comment.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -39,13 +39,13 @@ class WikiPlugin_Comment extends WikiPlugin { - public function getDescription() + public function getDescription(): string { return _("Embed hidden comments in WikiPages."); } // No arguments here. - public function getDefaultArguments() + public function getDefaultArguments(): array { return array(); } Modified: trunk/lib/plugin/CreateBib.php =================================================================== --- trunk/lib/plugin/CreateBib.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/CreateBib.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -34,12 +34,12 @@ class WikiPlugin_CreateBib extends WikiPlugin { - public function getDescription() + public function getDescription(): string { return _("Automatically create a Bibtex file from linked pages."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array('pagename' => '[pagename]'); // The page from which the BibTex file is generated } @@ -48,7 +48,7 @@ * @param array $content * @return array */ - private function extractBibTeX($content) + private function extractBibTeX(array $content): array { $bib = array(); @@ -77,7 +77,7 @@ * @param array $content * @return array */ - private function extractArticles($content) + private function extractArticles(array $content): array { $articles = array(); for ($i = 0; $i < count($content); $i++) { @@ -96,7 +96,7 @@ * @param WikiDB_Page $thispage * @param string $filename */ - private function dumpFile($thispage, $filename) + private function dumpFile($thispage, string $filename) { include_once 'lib/loadsave.php'; $mailified = MailifyPage($thispage); Modified: trunk/lib/plugin/CreatePage.php =================================================================== --- trunk/lib/plugin/CreatePage.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/CreatePage.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -39,12 +39,12 @@ class WikiPlugin_CreatePage extends WikiPlugin_Template { - public function getDescription() + public function getDescription(): string { return _("Create a wiki page by the provided name."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array('s' => false, 'initial_content' => '', Modified: trunk/lib/plugin/CreateToc.php =================================================================== --- trunk/lib/plugin/CreateToc.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/CreateToc.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -42,12 +42,12 @@ class WikiPlugin_CreateToc extends WikiPlugin { - public function getDescription() + public function getDescription(): string { return _("Create a Table of Contents and automatically link to headers."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array( 'extracollapse' => true, // provide an entry +/- link to collapse @@ -77,7 +77,7 @@ } } - private function roman_counter($number) + private function roman_counter($number): string { $n = intval($number); $result = ''; @@ -93,7 +93,7 @@ return $result; } - private function letter_counter($number) + private function letter_counter($number): string { if ($number <= 26) { return chr(ord("A") + $number - 1); @@ -121,7 +121,7 @@ } // Get HTML header corresponding to current level (level is set of ! or =) - private function getHeader($level) + private function getHeader($level): string { $count = substr_count($level, '!'); switch ($count) { @@ -148,7 +148,7 @@ return ""; } - private function quote($heading) + private function quote($heading): string { if (TOC_FULL_SYNTAX) { $theading = TransformInline($heading); @@ -262,7 +262,7 @@ $levels, $firstlevelstyle, $basepage - ) + ): array { if (!$levels) { $levels = array(1, 2); Modified: trunk/lib/plugin/CurrentTime.php =================================================================== --- trunk/lib/plugin/CurrentTime.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/CurrentTime.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -54,13 +54,13 @@ class WikiPlugin_CurrentTime extends WikiPlugin { - public function getDescription() + public function getDescription(): string { return _("Display current time and date."); } // Establish default values for each of this plugin's arguments. - public function getDefaultArguments() + public function getDefaultArguments(): array { return array('format' => '%Y-%m-%d %T'); } Modified: trunk/lib/plugin/DebugAuthInfo.php =================================================================== --- trunk/lib/plugin/DebugAuthInfo.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/DebugAuthInfo.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -34,12 +34,12 @@ class WikiPlugin_DebugAuthInfo extends WikiPlugin { - public function getDescription() + public function getDescription(): string { return _("Display general and user specific auth information."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array('userid' => ''); } @@ -143,7 +143,7 @@ } // needed to store serialized objects-values only (perm, pref) - private function obj2hash($obj, $exclude = array()) + private function obj2hash($obj, $exclude = array()): array { $a = array(); $fields = get_object_vars($obj); @@ -236,7 +236,7 @@ return $rows; } - private function buildConstHash($constants) + private function buildConstHash($constants): array { $hash = array(); foreach ($constants as $c) { Modified: trunk/lib/plugin/DebugBackendInfo.php =================================================================== --- trunk/lib/plugin/DebugBackendInfo.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/DebugBackendInfo.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -246,7 +246,7 @@ return $rows; } - private function _showvalue($val): RawXml + private function _showvalue($val) { return $val ? $val : HTML::raw(' '); } Modified: trunk/lib/plugin/DebugGroupInfo.php =================================================================== --- trunk/lib/plugin/DebugGroupInfo.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/DebugGroupInfo.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -28,12 +28,12 @@ class WikiPlugin_DebugGroupInfo extends WikiPlugin { - public function getDescription() + public function getDescription(): string { return _("Show Group Information."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array(); } Modified: trunk/lib/plugin/DebugRetransform.php =================================================================== --- trunk/lib/plugin/DebugRetransform.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/DebugRetransform.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -28,12 +28,12 @@ class WikiPlugin_DebugRetransform extends WikiPlugin { - public function getDescription() + public function getDescription(): string { return sprintf(_("Show a markup retransformation of page %s."), '[pagename]'); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array('page' => '[pagename]'); } Modified: trunk/lib/plugin/Diff.php =================================================================== --- trunk/lib/plugin/Diff.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/Diff.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -34,7 +34,7 @@ class WikiPlugin_Diff extends WikiPlugin { - public function getDescription() + public function getDescription(): string { return _("Display differences between revisions."); } @@ -41,7 +41,7 @@ // Establish default values for each of this plugin's arguments. // todo: makes only sense with more args. - public function getDefaultArguments() + public function getDefaultArguments(): array { return array('pagename' => '[pagename]', 'versions' => false, Modified: trunk/lib/plugin/DynamicIncludePage.php =================================================================== --- trunk/lib/plugin/DynamicIncludePage.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/DynamicIncludePage.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -32,12 +32,12 @@ class WikiPlugin_DynamicIncludePage extends WikiPlugin_IncludePage { - public function getDescription() + public function getDescription(): string { return _("Dynamically include the content from another wiki page."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array_merge( WikiPlugin_IncludePage::getDefaultArguments(), Modified: trunk/lib/plugin/EditMetaData.php =================================================================== --- trunk/lib/plugin/EditMetaData.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/EditMetaData.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -47,12 +47,12 @@ { public $_args; - public function getDescription() + public function getDescription(): string { return sprintf(_("Edit metadata for %s."), '[pagename]'); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array('page' => '[pagename]'); } Modified: trunk/lib/plugin/ExternalSearch.php =================================================================== --- trunk/lib/plugin/ExternalSearch.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/ExternalSearch.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -42,7 +42,7 @@ public $_name; public $_s; - public function getDescription() + public function getDescription(): string { return _("Redirect to an external web site based on form input."); //fixme: better description @@ -64,7 +64,7 @@ } } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array('s' => false, 'formsize' => 30, Modified: trunk/lib/plugin/FacebookLike.php =================================================================== --- trunk/lib/plugin/FacebookLike.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/FacebookLike.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -32,12 +32,12 @@ class WikiPlugin_FacebookLike extends WikiPlugin { - public function getDescription() + public function getDescription(): string { return _("Display a Facebook Like button."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array('width' => 450, 'height' => 35, Modified: trunk/lib/plugin/FileInfo.php =================================================================== --- trunk/lib/plugin/FileInfo.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/FileInfo.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -39,7 +39,7 @@ // you need to do: // yum install php-process if (!function_exists('posix_getpwuid')) { - function posix_getpwuid() + function posix_getpwuid(): bool { return false; } @@ -46,7 +46,7 @@ } if (!function_exists('posix_getgrgid')) { - function posix_getgrgid() + function posix_getgrgid(): bool { return false; } @@ -54,12 +54,12 @@ class WikiPlugin_FileInfo extends WikiPlugin { - public function getDescription() + public function getDescription(): string { return _("Display file information like size, date... of uploaded files."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array( 'file' => false, // relative path from PHPWIKI_DIR. (required) @@ -225,7 +225,7 @@ return $result; } - private function formatsize($n, $factor, $suffix) + private function formatsize($n, $factor, $suffix): string { if ($n > $factor) { $b = $n / $factor; @@ -235,7 +235,7 @@ return ''; } - private function phonysize($a) + private function phonysize($a): string { $factor = 1024 * 1024 * 1024; if ($a > $factor) { Modified: trunk/lib/plugin/FoafViewer.php =================================================================== --- trunk/lib/plugin/FoafViewer.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/FoafViewer.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -58,7 +58,7 @@ { // The handler is handled okay. The only problem is that it still // throws a fatal. - private function error_handler($error) + private function error_handler($error): bool { if (strstr($error->errstr, "Failed opening required 'XML/FOAF/Parser.php'")) { return true; @@ -68,12 +68,12 @@ return false; } - public function getDescription() + public function getDescription(): string { return _("Parse an RDF FOAF file and extract information to render as HTML."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array('foaf' => false, // the URI to parse //'userid' => false, @@ -214,7 +214,7 @@ * @todo Make sure it can look more than 1 layer deep * @todo Pass in dublincore metadata */ - public function iterateHTML($array, $index, $dc = null) + public function iterateHTML(array $array, int $index, $dc = null) { for ($i = 0; $i < count($array[$index]); $i++) { //Cater for different types Modified: trunk/lib/plugin/FullTextSearch.php =================================================================== --- trunk/lib/plugin/FullTextSearch.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/FullTextSearch.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -38,12 +38,12 @@ */ class WikiPlugin_FullTextSearch extends WikiPlugin { - public function getDescription() + public function getDescription(): string { return _("Search the content of all pages in this wiki."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { // All PageList::supportedArgs, except 'pagename' $args = array_merge( @@ -190,7 +190,7 @@ * @param string $hilight_re * @return array */ - public function showhits($page, $hilight_re) + public function showhits($page, string $hilight_re): array { $current = $page->getCurrentRevision(); $matches = preg_grep("/$hilight_re/i", $current->getContent()); @@ -205,7 +205,7 @@ return $html; } - public static function highlight_line($line, $hilight_re) + public static function highlight_line($line, $hilight_re): array { while (preg_match("/^(.*?)($hilight_re)/i", $line, $m)) { $line = substr($line, strlen($m[0])); Modified: trunk/lib/plugin/FuzzyPages.php =================================================================== --- trunk/lib/plugin/FuzzyPages.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/FuzzyPages.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -40,7 +40,7 @@ private $searchterm_metaphone; private $debug; - public function getDescription() + public function getDescription(): string { return sprintf( _("Search for page titles similar to %s."), @@ -48,13 +48,13 @@ ); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array('s' => '', 'debug' => false); } - private function spelling_similarity($subject) + private function spelling_similarity($subject): int { $spelling_similarity_score = 0; similar_text( @@ -65,7 +65,7 @@ return $spelling_similarity_score; } - private function sound_similarity($subject) + private function sound_similarity($subject): int { $sound_similarity_score = 0; similar_text( Modified: trunk/lib/plugin/GoTo.php =================================================================== --- trunk/lib/plugin/GoTo.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/GoTo.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -34,12 +34,12 @@ class WikiPlugin_GoTo extends WikiPlugin { - public function getDescription() + public function getDescription(): string { return _("Go to or create page."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array('size' => 32); } Modified: trunk/lib/plugin/GoogleMaps.php =================================================================== --- trunk/lib/plugin/GoogleMaps.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/GoogleMaps.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -59,12 +59,12 @@ class WikiPlugin_GoogleMaps extends WikiPlugin { - public function getDescription() + public function getDescription(): string { return _("Display a marker with further infos (when clicking) on given coordinates."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array( 'Longitude' => '', Modified: trunk/lib/plugin/GooglePlugin.php =================================================================== --- trunk/lib/plugin/GooglePlugin.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/GooglePlugin.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -41,12 +41,12 @@ class WikiPlugin_GooglePlugin extends WikiPlugin { - public function getDescription() + public function getDescription(): string { return _("Make use of the Google API."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array('q' => '', 'mode' => 'search', // or 'cache' or 'spell' Modified: trunk/lib/plugin/GraphViz.php =================================================================== --- trunk/lib/plugin/GraphViz.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/GraphViz.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -70,7 +70,7 @@ public $source; public $_mapfile; - private function mapTypes() + private function mapTypes(): array { return array("imap", "cmapx", "ismap", "cmap"); } @@ -80,7 +80,7 @@ * or HTML if the imagetype is not supported by GD (EPS, SVG, SVGZ) (not yet) * or IMG_INLINE if device = png, gif or jpeg */ - public function getPluginType() + public function getPluginType(): int { $type = $this->decideImgType($this->_args['imgtype']); if ($type == $this->_args['imgtype']) { @@ -108,12 +108,12 @@ return _("GraphViz image or imagemap creation of directed graphs."); } - public function managesValidators() + public function managesValidators(): bool { return true; } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array( 'imgtype' => 'png', // png,gif,svgz,svg,... @@ -135,7 +135,7 @@ * functions are called seldomly) or to about two minutes * if a help screen is created. */ - public function getExpire($dbi, $argarray, $request) + public function getExpire($dbi, $argarray, $request): string { if (!empty($argarray['help'])) { return '+120'; @@ -152,7 +152,7 @@ * @param Request $request * @return string 'png', 'jpeg', 'gif' */ - public function getImageType($dbi, $argarray, $request) + public function getImageType($dbi, $argarray, $request): string { return $argarray['imgtype']; } @@ -173,7 +173,7 @@ * TODO: *map features. * @return string image handle */ - public function helpImage() + public function helpImage(): string { $def = $this->defaultArguments(); $imgtypes = $GLOBALS['PLUGIN_CACHED_IMGTYPES']; @@ -206,7 +206,7 @@ ); } - public function processSource($argarray = array()) + public function processSource($argarray = array()): string { if (empty($this->source)) { // create digraph from pages @@ -249,7 +249,7 @@ * @param array $argarray * @return mixed */ - public function createDotFile($tempfile = '', $argarray = array()) + public function createDotFile(string $tempfile = '', array $argarray = array()) { $this->source = $this->processSource($argarray); if (!$this->source) { @@ -348,12 +348,12 @@ * * @return string */ - protected function pngArg() + protected function pngArg(): string { return 'imgtype'; } - protected function getMap($dbi, $argarray, $request) + protected function getMap($dbi, $argarray, $request): array { $result = $this->invokeDot($argarray); if (is_a($result, 'HtmlElement')) { @@ -378,7 +378,7 @@ * @param label string not used anymore * @return array */ - public function invokeDot($argarray) + public function invokeDot($argarray): array { /** * @var WikiRequest $request Modified: trunk/lib/plugin/HelloWorld.php =================================================================== --- trunk/lib/plugin/HelloWorld.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/HelloWorld.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -42,13 +42,13 @@ class WikiPlugin_HelloWorld extends WikiPlugin { - public function getDescription() + public function getDescription(): string { return _("Simple Sample Plugin."); } // Establish default values for each of this plugin's arguments. - public function getDefaultArguments() + public function getDefaultArguments(): array { return array('salutation' => "Hello", 'name' => "World"); Modified: trunk/lib/plugin/HtmlConverter.php =================================================================== --- trunk/lib/plugin/HtmlConverter.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/HtmlConverter.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -34,12 +34,12 @@ class WikiPlugin_HtmlConverter extends WikiPlugin { - public function getDescription() + public function getDescription(): string { return _("Convert HTML markup into wiki markup."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array(); } Modified: trunk/lib/plugin/IncludePage.php =================================================================== --- trunk/lib/plugin/IncludePage.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/IncludePage.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -31,12 +31,12 @@ class WikiPlugin_IncludePage extends WikiPlugin { - public function getDescription() + public function getDescription(): string { return _("Include text from another wiki page."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array( 'page' => false, // the page to include @@ -51,7 +51,7 @@ ); } - public function getWikiPageLinks($argstr, $basepage) + public function getWikiPageLinks($argstr, $basepage): array { $args = $this->getArgs($argstr); $page = isset($args['page']) ? $args['page'] : ''; @@ -224,7 +224,7 @@ * Handles the arguments: section, sectionhead, lines, words, bytes, * for UnfoldSubpages, IncludePage, ... */ - protected function extractParts($c, $pagename, $args) + protected function extractParts($c, $pagename, $args): string { extract($args); Modified: trunk/lib/plugin/IncludePages.php =================================================================== --- trunk/lib/plugin/IncludePages.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/IncludePages.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -32,12 +32,12 @@ class WikiPlugin_IncludePages extends WikiPlugin_IncludePage { - public function getDescription() + public function getDescription(): string { return _("Include multiple pages."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array_merge( array('pages' => '', // the pages to include @@ -46,7 +46,7 @@ ); } - public function getWikiPageLinks($argstr, $basepage) + public function getWikiPageLinks($argstr, $basepage): array { $args = $this->getArgs($argstr); if (is_string($args['exclude']) and !empty($args['exclude'])) { Modified: trunk/lib/plugin/IncludeSiteMap.php =================================================================== --- trunk/lib/plugin/IncludeSiteMap.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/IncludeSiteMap.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -49,12 +49,12 @@ class WikiPlugin_IncludeSiteMap extends WikiPlugin_SiteMap { - public function getDescription() + public function getDescription(): string { return _("Include recursively all linked pages starting at [pagename]."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array('exclude' => '', 'include_self' => false, Modified: trunk/lib/plugin/IncludeTree.php =================================================================== --- trunk/lib/plugin/IncludeTree.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/IncludeTree.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -36,12 +36,12 @@ class WikiPlugin_IncludeTree extends WikiPlugin_SiteMap { - public function getDescription() + public function getDescription(): string { return _("Display Dynamic Category Tree."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array('exclude' => '', 'include_self' => false, Modified: trunk/lib/plugin/InterWikiSearch.php =================================================================== --- trunk/lib/plugin/InterWikiSearch.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/InterWikiSearch.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -26,12 +26,12 @@ class WikiPlugin_InterWikiSearch extends WikiPlugin { - public function getDescription() + public function getDescription(): string { return _("Perform searches on InterWiki sites listed in InterWikiMap."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array('s' => '', 'formsize' => 30, Modified: trunk/lib/plugin/JabberPresence.php =================================================================== --- trunk/lib/plugin/JabberPresence.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/JabberPresence.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -45,13 +45,13 @@ class WikiPlugin_JabberPresence extends WikiPlugin { - public function getDescription() + public function getDescription(): string { return _("Display Jabber presence."); } // Establish default values for each of this plugin's arguments. - public function getDefaultArguments() + public function getDefaultArguments(): array { return array('scripturl' => "http://edgar.netflint.net/status.php", 'jid' => MY_JABBER_ID, Modified: trunk/lib/plugin/LdapSearch.php =================================================================== --- trunk/lib/plugin/LdapSearch.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/LdapSearch.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -51,12 +51,12 @@ class WikiPlugin_LdapSearch extends WikiPlugin { - public function getDescription() + public function getDescription(): string { return _("Search an LDAP directory."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array('host' => "", // default: LDAP_AUTH_HOST 'port' => 389, // ignored if host = full uri Modified: trunk/lib/plugin/LikePages.php =================================================================== --- trunk/lib/plugin/LikePages.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/LikePages.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -27,7 +27,7 @@ class WikiPlugin_LikePages extends WikiPlugin { - public function getDescription() + public function getDescription(): string { return sprintf( _("List page names which share an initial or final title word with “%s”."), @@ -35,7 +35,7 @@ ); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array_merge( PageList::supportedArgs(), @@ -133,7 +133,7 @@ return $pagelist; } - private function _quote($str) + private function _quote($str): string { return "'" . str_replace("'", "''", $str) . "'"; } Modified: trunk/lib/plugin/LinkDatabase.php =================================================================== --- trunk/lib/plugin/LinkDatabase.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/LinkDatabase.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -39,7 +39,7 @@ */ class WikiPlugin_LinkDatabase extends WikiPluginCached { - public function getPluginType() + public function getPluginType(): int { return PLUGIN_CACHED_HTML; } @@ -49,12 +49,12 @@ return _("List all pages with all links in various formats for some Java Visualization tools."); } - public function getExpire($dbi, $argarray, $request) + public function getExpire($dbi, $argarray, $request): string { return '+900'; // 15 minutes } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array_merge( PageList::supportedArgs(), Modified: trunk/lib/plugin/LinkSearch.php =================================================================== --- trunk/lib/plugin/LinkSearch.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/LinkSearch.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -35,12 +35,12 @@ { public $current_row; - public function getDescription() + public function getDescription(): string { return _("Search page and link names."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array_merge( PageList::supportedArgs(), // paging and more. Modified: trunk/lib/plugin/ListPages.php =================================================================== --- trunk/lib/plugin/ListPages.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/ListPages.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -36,12 +36,12 @@ class WikiPlugin_ListPages extends WikiPlugin { - public function getDescription() + public function getDescription(): string { return _("List pages that are explicitly given as the pages argument."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array_merge( PageList::supportedArgs(), Modified: trunk/lib/plugin/ListRelations.php =================================================================== --- trunk/lib/plugin/ListRelations.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/ListRelations.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -32,12 +32,12 @@ class WikiPlugin_ListRelations extends WikiPlugin { - public function getDescription() + public function getDescription(): string { return _("Display the list of all defined relations and optionnally attributes in this entire wiki."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array_merge( PageList::supportedArgs(), // paging and more. Modified: trunk/lib/plugin/ListSubpages.php =================================================================== --- trunk/lib/plugin/ListSubpages.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/ListSubpages.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -32,12 +32,12 @@ class WikiPlugin_ListSubpages extends WikiPlugin { - public function getDescription() + public function getDescription(): string { return _("Lists the names of all SubPages of the current page."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array_merge( PageList::supportedArgs(), Modified: trunk/lib/plugin/MediawikiTable.php =================================================================== --- trunk/lib/plugin/MediawikiTable.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/MediawikiTable.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -54,12 +54,12 @@ class WikiPlugin_MediawikiTable extends WikiPlugin { - public function getDescription() + public function getDescription(): string { return _("Layout tables using a Mediawiki-like markup style."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array(); } @@ -71,7 +71,7 @@ * @param string $basepage The pagename the plugin is invoked from. * @return array List of pagenames linked to. */ - public function getWikiPageLinks($argstr, $basepage) + public function getWikiPageLinks($argstr, $basepage): array { return getTextLinks($argstr); } Modified: trunk/lib/plugin/ModeratedPage.php =================================================================== --- trunk/lib/plugin/ModeratedPage.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/ModeratedPage.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -41,12 +41,12 @@ { public $_tokens; - public function getDescription() + public function getDescription(): string { return _("Support moderated pages."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array('page' => '[pagename]', 'moderators' => false, @@ -111,7 +111,7 @@ * @param string $argstr * @return array */ - public function resolve_argstr(&$request, $argstr) + public function resolve_argstr(&$request, $argstr): array { $args = $this->getArgs($argstr); $group = $request->getGroup(); @@ -169,7 +169,7 @@ * @param array $moderated * @return bool|HtmlElement */ - public function lock_check(&$request, &$page, $moderated) + public function lock_check(&$request, &$page, array $moderated) { $action_page = $request->getPage(_("ModeratedPage")); $status = $this->getSiteStatus($request, $action_page); @@ -253,7 +253,7 @@ * @param WikiDB_Page $page * @return bool */ - public function handler(&$request, &$page) + public function handler(&$request, &$page): bool { $action = $request->getArg('action'); $moderated = $page->get('moderated'); @@ -349,7 +349,7 @@ * @param array $moderation * @return HtmlElement|string */ - public function approve(&$request, $args, &$moderation) + public function approve(&$request, array $args, array &$moderation) { if ($request->isPost()) { // this is unsafe because we dont know if it will succeed. but we tried. @@ -387,7 +387,7 @@ * @param array $moderation * @return HtmlElement|string */ - public function reject(&$request, $args, &$moderation) + public function reject(&$request, array $args, array &$moderation) { // check id, delete action if ($request->isPost()) { @@ -404,7 +404,7 @@ * @param array $args * @param array $moderation */ - public function cleanup_and_notify(&$request, $args, &$moderation) + public function cleanup_and_notify(&$request, array $args, array &$moderation) { $pagename = $moderation['args']['pagename']; $page = $request->_dbi->getPage($pagename); @@ -446,7 +446,7 @@ * @param string $pass * @return HtmlElement */ - private function approval_form(&$request, $args, $moderation, $pass = 'approve') + private function approval_form(&$request, array $args, array $moderation, string $pass = 'approve') { $header = HTML::h3(_("Please approve or reject this request:")); Modified: trunk/lib/plugin/MostPopular.php =================================================================== --- trunk/lib/plugin/MostPopular.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/MostPopular.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -27,12 +27,12 @@ class WikiPlugin_MostPopular extends WikiPlugin { - public function getDescription() + public function getDescription(): string { return _("List the most popular pages."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array_merge( PageList::supportedArgs(), Modified: trunk/lib/plugin/NewPagesPerUser.php =================================================================== --- trunk/lib/plugin/NewPagesPerUser.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/NewPagesPerUser.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -32,7 +32,7 @@ class WikiPlugin_NewPagesPerUser extends WikiPlugin { - private function cmp_by_count($a, $b) + private function cmp_by_count($a, $b): int { if ($a['count'] == $b['count']) { return 0; @@ -40,12 +40,12 @@ return $a['count'] < $b['count'] ? 1 : -1; } - public function getDescription() + public function getDescription(): string { return _("List all new pages per month per user."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array('userid' => '', 'month' => '', Modified: trunk/lib/plugin/NoCache.php =================================================================== --- trunk/lib/plugin/NoCache.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/NoCache.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -38,12 +38,12 @@ class WikiPlugin_NoCache extends WikiPlugin { - public function getDescription() + public function getDescription(): string { return _("Don't cache this page."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array('nocache' => 1); } Modified: trunk/lib/plugin/OldStyleTable.php =================================================================== --- trunk/lib/plugin/OldStyleTable.php 2023-07-13 19:30:51 UTC (rev 11047) +++ trunk/lib/plugin/OldStyleTable.php 2023-07-14 09:19:32 UTC (rev 11048) @@ -47,12 +47,12 @@ class WikiPlugin_OldStyleTable extends WikiPlugin { - public function getDescription() + public function getDescription(): string { return _("Layout tables using the old markup style."); } - public function getDefaultArguments() + public function getDefaultArguments(): array { return array( 'caption' => '', @@ -69,7 +69,7 @@ * @param stri... [truncated message content] |
From: <car...@us...> - 2025-02-14 04:37:32
|
Revision: 11097 http://sourceforge.net/p/phpwiki/code/11097 Author: carstenklapp Date: 2025-02-14 04:37:31 +0000 (Fri, 14 Feb 2025) Log Message: ----------- Added display of plugins not allowed to SystemInfo and formatting date in DebugBackendInfo. Modified Paths: -------------- trunk/lib/plugin/DebugBackendInfo.php trunk/lib/plugin/SystemInfo.php Modified: trunk/lib/plugin/DebugBackendInfo.php =================================================================== --- trunk/lib/plugin/DebugBackendInfo.php 2025-02-14 04:32:37 UTC (rev 11096) +++ trunk/lib/plugin/DebugBackendInfo.php 2025-02-14 04:37:31 UTC (rev 11097) @@ -147,6 +147,7 @@ if (!is_array($data)) { return; } + //print_r($data);////debugging global $request; $user = $request->getUser(); @@ -154,6 +155,8 @@ $fullkey = $prefix . '[' . $key . ']'; if (is_integer($key)) { ; + } elseif (($key == 'mtime')||($key == 'date'||($key == '_supplanted'))) { + $data[$key] = $val . " " . Rfc2822DateTime($val);//print nice date too } elseif ($key == 'passwd' and !$user->isAdmin()) { $data[$key] = $val ? _("<not displayed>") : _("<empty>"); } elseif ($key and $key == '_cached_html') { Modified: trunk/lib/plugin/SystemInfo.php =================================================================== --- trunk/lib/plugin/SystemInfo.php 2025-02-14 04:32:37 UTC (rev 11096) +++ trunk/lib/plugin/SystemInfo.php 2025-02-14 04:37:31 UTC (rev 11097) @@ -473,6 +473,30 @@ . implode(', ', array_map($plugin_function, $list)); } + public function notallowed_plugins() + { + global $AllAllowedPlugins; + $fileset = new FileSet(findFile('lib/plugin'), '*.php'); + $list = $fileset->getFiles(); + natcasesort($list); + reset($list); + $plugin_function = function ($f) { + return substr($f, 0, -4); + }; + $filteredpluginslist = array_map($plugin_function, $list); + foreach ($filteredpluginslist as $key => $pluginfound) { + if (in_array($pluginfound, $AllAllowedPlugins)) + { + //echo $pluginfound ." is allowed, "; + unset($filteredpluginslist[$key]); + } else { + //echo $pluginfound ." is not allowed, "; + } + } + return sprintf(_("Total %d plugins: "), count($filteredpluginslist)) + . implode(', ', $filteredpluginslist); + } + public function supported_languages() { $available_languages = listAvailableLanguages(); @@ -577,7 +601,8 @@ 'wikinameregexp' => _("Wikiname regexp"), 'allowedprotocols' => _("Allowed protocols"), 'inlineimages' => _("Inline images"), - 'available_plugins' => _("Available plugins"), + 'available_plugins' => _("Plugins installed"), + 'notallowed_plugins' => _("Plugins not allowed"), 'supported_languages' => _("Supported languages"), 'supported_themes' => _("Supported themes"), // '' => _(""), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |