|
From: <var...@us...> - 2021-09-20 08:23:23
|
Revision: 10573
http://sourceforge.net/p/phpwiki/code/10573
Author: vargenau
Date: 2021-09-20 08:23:20 +0000 (Mon, 20 Sep 2021)
Log Message:
-----------
Remove useless local variable
Modified Paths:
--------------
trunk/lib/BlockParser.php
trunk/lib/HttpClient.php
trunk/lib/PageList.php
trunk/lib/editpage.php
trunk/lib/loadsave.php
trunk/lib/plugin/BackLinks.php
trunk/lib/plugin/Diff.php
trunk/lib/plugin/IncludePage.php
trunk/lib/plugin/LinkSearch.php
trunk/lib/plugin/ListPages.php
trunk/lib/plugin/ListSubpages.php
trunk/lib/plugin/RawHtml.php
trunk/lib/plugin/SemanticSearchAdvanced.php
trunk/lib/plugin/SystemInfo.php
trunk/lib/plugin/UriResolver.php
trunk/lib/plugin/VisualWiki.php
trunk/lib/plugin/WikiAdminSetAclSimple.php
trunk/lib/stdlib.php
Modified: trunk/lib/BlockParser.php
===================================================================
--- trunk/lib/BlockParser.php 2021-09-20 07:56:53 UTC (rev 10572)
+++ trunk/lib/BlockParser.php 2021-09-20 08:23:20 UTC (rev 10573)
@@ -1423,9 +1423,7 @@
}
// Expand leading tabs.
$text = expand_tabs($text);
- $output = new WikiText($text);
-
- return $output;
+ return new WikiText($text);
}
/**
Modified: trunk/lib/HttpClient.php
===================================================================
--- trunk/lib/HttpClient.php 2021-09-20 07:56:53 UTC (rev 10572)
+++ trunk/lib/HttpClient.php 2021-09-20 08:23:20 UTC (rev 10573)
@@ -295,8 +295,7 @@
$headers[] = 'Content-Type: ' . $ContentType;
$headers[] = 'Content-Length: ' . strlen($this->postdata);
}
- $request = implode("\r\n", $headers) . "\r\n\r\n" . $this->postdata;
- return $request;
+ return implode("\r\n", $headers) . "\r\n\r\n" . $this->postdata;
}
function getStatus()
Modified: trunk/lib/PageList.php
===================================================================
--- trunk/lib/PageList.php 2021-09-20 07:56:53 UTC (rev 10572)
+++ trunk/lib/PageList.php 2021-09-20 08:23:20 UTC (rev 10573)
@@ -1091,8 +1091,7 @@
return $order . $column;
} elseif ($action == 'check') { // show icon?
//if specified via arg or if clicked
- $show = (!empty($this->_sortby[$column]) or $this->sortby($column, 'clicked'));
- return $show;
+ return (!empty($this->_sortby[$column]) or $this->sortby($column, 'clicked'));
} elseif ($action == 'clicked') { // flip sort order?
global $request;
$arg = $request->getArg('sortby');
Modified: trunk/lib/editpage.php
===================================================================
--- trunk/lib/editpage.php 2021-09-20 07:56:53 UTC (rev 10572)
+++ trunk/lib/editpage.php 2021-09-20 08:23:20 UTC (rev 10573)
@@ -841,7 +841,7 @@
}
if (!$categories) return '';
// Ensure this to be inserted at the very end. Hence we added the id to the function.
- $more_buttons = HTML::img(array('class' => "toolbar",
+ return HTML::img(array('class' => "toolbar",
'id' => 'tb-categories',
'src' => $WikiTheme->getImageURL("ed_category.png"),
'title' => _("Insert Categories"),
@@ -851,7 +851,6 @@
. "',[" . join(",", $categories) . "],'"
. _("Insert") . "','"
. _("Close") . "','tb-categories')"));
- return $more_buttons;
}
return '';
}
@@ -891,7 +890,7 @@
}
}
$plugin_js = substr($plugin_js, 1);
- $more_buttons = HTML::img(array('class' => "toolbar",
+ return HTML::img(array('class' => "toolbar",
'id' => 'tb-plugins',
'src' => $WikiTheme->getImageURL("ed_plugins.png"),
'title' => _("Insert Plugin"),
@@ -901,7 +900,6 @@
. "',[" . $plugin_js . "],'"
. _("Insert") . "','"
. _("Close") . "','tb-plugins')"));
- return $more_buttons;
}
return '';
}
@@ -1270,10 +1268,9 @@
protected function getConflictMessage($unresolved = false)
{
- $message = HTML(HTML::p(fmt("Some of the changes could not automatically be combined. Please look for sections beginning with “%s”, and ending with “%s”. You will need to edit those sections by hand before you click Save.",
+ return HTML(HTML::p(fmt("Some of the changes could not automatically be combined. Please look for sections beginning with “%s”, and ending with “%s”. You will need to edit those sections by hand before you click Save.",
"<<<<<<<",
"======="),
HTML::p(_("Please check it through before saving."))));
- return $message;
}
}
Modified: trunk/lib/loadsave.php
===================================================================
--- trunk/lib/loadsave.php 2021-09-20 07:56:53 UTC (rev 10572)
+++ trunk/lib/loadsave.php 2021-09-20 08:23:20 UTC (rev 10573)
@@ -1165,8 +1165,7 @@
$fd = fopen($mapfile, "rb");
$data = fread($fd, filesize($mapfile));
fclose($fd);
- $content = $content . "\n<verbatim>\n$data</verbatim>\n";
- return $content;
+ return $content . "\n<verbatim>\n$data</verbatim>\n";
}
function ParseSerializedPage($text, $default_pagename, $user)
Modified: trunk/lib/plugin/BackLinks.php
===================================================================
--- trunk/lib/plugin/BackLinks.php 2021-09-20 07:56:53 UTC (rev 10572)
+++ trunk/lib/plugin/BackLinks.php 2021-09-20 08:23:20 UTC (rev 10573)
@@ -218,7 +218,6 @@
function _getValue($page_handle, $revision_handle)
{
$iter = $page_handle->getPageLinks();
- $count = $iter->count();
- return $count;
+ return $iter->count();
}
}
Modified: trunk/lib/plugin/Diff.php
===================================================================
--- trunk/lib/plugin/Diff.php 2021-09-20 07:56:53 UTC (rev 10572)
+++ trunk/lib/plugin/Diff.php 2021-09-20 08:23:20 UTC (rev 10573)
@@ -102,9 +102,8 @@
$page = $request->getPage($pagename);
$current = $page->getCurrentRevision();
if ($current->getVersion() < 1) {
- $html = HTML(HTML::p(fmt("Page “%s” does not exist.",
- WikiLink($pagename, 'unknown'))));
- return $html; //early return
+ return HTML(HTML::p(fmt("Page “%s” does not exist.",
+ WikiLink($pagename, 'unknown')))); //early return
}
if ($version) {
Modified: trunk/lib/plugin/IncludePage.php
===================================================================
--- trunk/lib/plugin/IncludePage.php 2021-09-20 07:56:53 UTC (rev 10572)
+++ trunk/lib/plugin/IncludePage.php 2021-09-20 08:23:20 UTC (rev 10573)
@@ -231,7 +231,6 @@
$c = array($ct, sprintf(_(" ... first %d bytes"), $bytes));
}
}
- $ct = implode("\n", $c); // one string
- return $ct;
+ return implode("\n", $c); // one string
}
}
Modified: trunk/lib/plugin/LinkSearch.php
===================================================================
--- trunk/lib/plugin/LinkSearch.php 2021-09-20 07:56:53 UTC (rev 10572)
+++ trunk/lib/plugin/LinkSearch.php 2021-09-20 08:23:20 UTC (rev 10573)
@@ -112,7 +112,7 @@
*/
$submit = Button('submit:search', _("LinkSearch"));
$instructions = _("Search in pages for links with the matching name.");
- $form = HTML::form(array('action' => $action,
+ return HTML::form(array('action' => $action,
'method' => 'get',
'accept-charset' => 'UTF-8'),
$dirsign_switch,
@@ -123,7 +123,6 @@
$query,
HTML::raw(' '), $direction,
HTML::raw(' '), $submit);
- return $form;
}
/**
Modified: trunk/lib/plugin/ListPages.php
===================================================================
--- trunk/lib/plugin/ListPages.php 2021-09-20 07:56:53 UTC (rev 10572)
+++ trunk/lib/plugin/ListPages.php 2021-09-20 08:23:20 UTC (rev 10573)
@@ -149,7 +149,6 @@
function _getValue($page_handle, $revision_handle)
{
$iter = $page_handle->getLinks($this->_direction);
- $count = $iter->count();
- return $count;
+ return $iter->count();
}
}
Modified: trunk/lib/plugin/ListSubpages.php
===================================================================
--- trunk/lib/plugin/ListSubpages.php 2021-09-20 07:56:53 UTC (rev 10572)
+++ trunk/lib/plugin/ListSubpages.php 2021-09-20 08:23:20 UTC (rev 10573)
@@ -141,7 +141,6 @@
function _getValue($page_handle, $revision_handle)
{
$iter = $page_handle->getBackLinks();
- $count = $iter->count();
- return $count;
+ return $iter->count();
}
}
Modified: trunk/lib/plugin/RawHtml.php
===================================================================
--- trunk/lib/plugin/RawHtml.php 2021-09-20 07:56:53 UTC (rev 10572)
+++ trunk/lib/plugin/RawHtml.php 2021-09-20 08:23:20 UTC (rev 10573)
@@ -182,8 +182,7 @@
// anything with ="javascript: is right out -- strip all tags and return if found
$pattern = "/=\s*\S+script:\S+/Ui";
if (preg_match($pattern, $html)) {
- $html = strip_tags($html);
- return $html;
+ return strip_tags($html);
}
// setup -- $allowedtags is an array of $tag=>$closeit pairs, where $tag is an HTML tag to allow and $closeit is 1 if the tag requires a matching, closing tag
Modified: trunk/lib/plugin/SemanticSearchAdvanced.php
===================================================================
--- trunk/lib/plugin/SemanticSearchAdvanced.php 2021-09-20 07:56:53 UTC (rev 10572)
+++ trunk/lib/plugin/SemanticSearchAdvanced.php 2021-09-20 08:23:20 UTC (rev 10573)
@@ -109,7 +109,7 @@
$submit = Button('submit:semsearch[relations]', _("Search"), false,
array('title' => 'Move to help page. No separate window'));
$instructions = _("Search in all specified pages for the expression.");
- $form = HTML::form(array('action' => $action,
+ return HTML::form(array('action' => $action,
'method' => 'post',
'accept-charset' => 'UTF-8'),
$reldef,
@@ -123,7 +123,6 @@
$querybox))),
HTML::br(),
HTML::div(array('class' => 'align-center'), $submit));
- return $form;
}
/**
Modified: trunk/lib/plugin/SystemInfo.php
===================================================================
--- trunk/lib/plugin/SystemInfo.php 2021-09-20 07:56:53 UTC (rev 10572)
+++ trunk/lib/plugin/SystemInfo.php 2021-09-20 08:23:20 UTC (rev 10573)
@@ -168,8 +168,7 @@
// Any useful numbers similar to a VisualWiki interestmap?
function linkstats()
{
- $s = _("not yet");
- return $s;
+ return _("not yet");
}
// number of homepages: easy
Modified: trunk/lib/plugin/UriResolver.php
===================================================================
--- trunk/lib/plugin/UriResolver.php 2021-09-20 07:56:53 UTC (rev 10572)
+++ trunk/lib/plugin/UriResolver.php 2021-09-20 08:23:20 UTC (rev 10573)
@@ -69,7 +69,6 @@
unset($args['start_debug']);
// FIXME: ?Test=1 => Test
$arg = join("/", array_keys($args));
- $xmlid = RdfWriter::makeXMLExportId($arg);
- return $xmlid;
+ return RdfWriter::makeXMLExportId($arg);
}
}
Modified: trunk/lib/plugin/VisualWiki.php
===================================================================
--- trunk/lib/plugin/VisualWiki.php 2021-09-20 07:56:53 UTC (rev 10572)
+++ trunk/lib/plugin/VisualWiki.php 2021-09-20 08:23:20 UTC (rev 10573)
@@ -605,8 +605,7 @@
if ($promille * 1000 < $pro)
return $col;
}
- $lastcol = end($this->ColorTab);
- return $lastcol;
+ return end($this->ColorTab);
}
}
Modified: trunk/lib/plugin/WikiAdminSetAclSimple.php
===================================================================
--- trunk/lib/plugin/WikiAdminSetAclSimple.php 2021-09-20 07:56:53 UTC (rev 10572)
+++ trunk/lib/plugin/WikiAdminSetAclSimple.php 2021-09-20 08:23:20 UTC (rev 10573)
@@ -130,7 +130,7 @@
private function liberalPerms()
{
- $perm = array('view' => array(ACL_EVERY => true),
+ return array('view' => array(ACL_EVERY => true),
'edit' => array(ACL_EVERY => true),
'create' => array(ACL_EVERY => true),
'list' => array(ACL_EVERY => true),
@@ -142,7 +142,6 @@
ACL_OWNER => true),
'change' => array(ACL_ADMIN => true,
ACL_OWNER => true));
- return $perm;
}
/*
@@ -156,7 +155,7 @@
private function restrictedPerms()
{
- $perm = array('view' => array(ACL_AUTHENTICATED => true,
+ return array('view' => array(ACL_AUTHENTICATED => true,
ACL_EVERY => false),
'edit' => array(ACL_AUTHENTICATED => true,
ACL_EVERY => false),
@@ -172,7 +171,6 @@
ACL_OWNER => true),
'change' => array(ACL_ADMIN => true,
ACL_OWNER => true));
- return $perm;
}
function setaclFormSimple(&$header, $pagehash)
Modified: trunk/lib/stdlib.php
===================================================================
--- trunk/lib/stdlib.php 2021-09-20 07:56:53 UTC (rev 10572)
+++ trunk/lib/stdlib.php 2021-09-20 08:23:20 UTC (rev 10573)
@@ -381,8 +381,7 @@
{
// FIXME: Is this needed (or sufficient?)
if (!IsSafeURL($url)) {
- $link = HTML::span(array('class' => 'error'), _('Bad URL').' -- '._('Remove all of <, >, "'));
- return $link;
+ return HTML::span(array('class' => 'error'), _('Bad URL').' -- '._('Remove all of <, >, "'));
} else {
if (!$linktext)
$linktext = preg_replace("/mailto:/A", "", $url);
@@ -419,8 +418,7 @@
$arr = explode(' ', $url);
if (!empty($arr)) $url = $arr[0];
if (!IsSafeURL($url)) {
- $link = HTML::span(array('class' => 'error'), _('Bad URL for image').' -- '._('Remove all of <, >, "'));
- return $link;
+ return HTML::span(array('class' => 'error'), _('Bad URL for image').' -- '._('Remove all of <, >, "'));
}
// spaces in inline images must be %20 encoded!
$link = HTML::img(array('src' => $url));
@@ -471,10 +469,9 @@
}
} else {
$url = substr(strrchr($ori_url, "/"), 1);
- $link = HTML::span(array('class' => 'error'),
+ return HTML::span(array('class' => 'error'),
sprintf(_("Invalid attribute %s=%s for image %s"),
$attr, $value, $url));
- return $link;
}
}
// Correct silently the most common error
@@ -508,9 +505,8 @@
($height < 3 and $width < 20) or
($height < 7 and $width < 7)
) {
- $link = HTML::span(array('class' => 'error'),
+ return HTML::span(array('class' => 'error'),
_("Invalid image size"));
- return $link;
}
} else {
$size = 0;
@@ -545,9 +541,8 @@
or ($height < 3 and $width < 20)
or ($height < 7 and $width < 7)
) {
- $link = HTML::span(array('class' => 'error'),
+ return HTML::span(array('class' => 'error'),
_("Invalid image size"));
- return $link;
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|