|
From: <var...@us...> - 2021-09-20 12:47:17
|
Revision: 10594
http://sourceforge.net/p/phpwiki/code/10594
Author: vargenau
Date: 2021-09-20 12:47:14 +0000 (Mon, 20 Sep 2021)
Log Message:
-----------
Use parameter default value
Modified Paths:
--------------
trunk/lib/BlockParser.php
trunk/lib/Captcha.php
trunk/lib/PageList.php
trunk/lib/PageType.php
trunk/lib/Request.php
trunk/lib/SemanticWeb.php
trunk/lib/WikiDB.php
trunk/lib/WikiGroup.php
trunk/lib/WikiPlugin.php
trunk/lib/WikiPluginCached.php
trunk/lib/WikiTheme.php
trunk/lib/WikiUser.php
trunk/lib/XmlElement.php
trunk/lib/diff.php
trunk/lib/loadsave.php
trunk/lib/main.php
trunk/lib/plugin/SystemInfo.php
trunk/lib/prepend.php
Modified: trunk/lib/BlockParser.php
===================================================================
--- trunk/lib/BlockParser.php 2021-09-20 12:39:40 UTC (rev 10593)
+++ trunk/lib/BlockParser.php 2021-09-20 12:47:14 UTC (rev 10594)
@@ -461,7 +461,7 @@
if ($line === false or $line === '') // allow $line === '0'
return false;
- trigger_error("Couldn't match block: '$line'", E_USER_NOTICE);
+ trigger_error("Couldn't match block: '$line'");
return false;
}
}
Modified: trunk/lib/Captcha.php
===================================================================
--- trunk/lib/Captcha.php 2021-09-20 12:39:40 UTC (rev 10593)
+++ trunk/lib/Captcha.php 2021-09-20 12:47:14 UTC (rev 10594)
@@ -85,7 +85,7 @@
'name' => 'edit[captcha_input]',
'size' => $this->length + 2,
'maxlength' => 256));
- $url = WikiURL("", array("action" => "captcha", "id" => time()), false);
+ $url = WikiURL("", array("action" => "captcha", "id" => time()));
$el['CAPTCHA_IMAGE'] = HTML::img(array('src' => $url, 'alt' => 'captcha'));
$el['CAPTCHA_LABEL'] = HTML::label(array('for' => 'edit-captcha_input'),
_("Type word above:"));
Modified: trunk/lib/PageList.php
===================================================================
--- trunk/lib/PageList.php 2021-09-20 12:39:40 UTC (rev 10593)
+++ trunk/lib/PageList.php 2021-09-20 12:47:14 UTC (rev 10594)
@@ -269,7 +269,7 @@
function _getSortableValue($page_handle, $revision_handle)
{
if (!$revision_handle)
- $revision_handle = $page_handle->getCurrentRevision(true);
+ $revision_handle = $page_handle->getCurrentRevision();
return (empty($revision_handle->_data['%content']))
? 0 : strlen($revision_handle->_data['%content']);
}
@@ -405,7 +405,7 @@
if (!$revision_handle or (!$revision_handle->_data['%content']
or $revision_handle->_data['%content'] === true)
) {
- $revision_handle = $page_handle->getCurrentRevision(true);
+ $revision_handle = $page_handle->getCurrentRevision();
}
if (!empty($revision_handle->_data['%pagedata'])) {
$revision_handle->_data['%pagedata']['_cached_html'] = '';
@@ -558,7 +558,7 @@
function _getValue($page_handle, $revision_handle)
{
if ($this->dbi->isWikiPage($page_handle->getName()))
- return WikiLink($page_handle, 'known');
+ return WikiLink($page_handle);
else
return WikiLink($page_handle, 'unknown');
}
@@ -1397,7 +1397,7 @@
'averagerating', 'top3recs',
'relation', 'linkto');
if (!in_array($column, $silently_ignore))
- trigger_error(sprintf("%s: Bad column", $column), E_USER_NOTICE);
+ trigger_error(sprintf("%s: Bad column", $column));
return false;
}
if (!(defined('FUSIONFORGE') && FUSIONFORGE)) {
Modified: trunk/lib/PageType.php
===================================================================
--- trunk/lib/PageType.php 2021-09-20 12:39:40 UTC (rev 10593)
+++ trunk/lib/PageType.php 2021-09-20 12:47:14 UTC (rev 10594)
@@ -338,7 +338,7 @@
if (defined('WARN_NONPUBLIC_INTERWIKIMAP') and WARN_NONPUBLIC_INTERWIKIMAP) {
$error_html = sprintf(_("Loading InterWikiMap from external file %s."),
INTERWIKI_MAP_FILE);
- trigger_error($error_html, E_USER_NOTICE);
+ trigger_error($error_html);
}
if (file_exists(INTERWIKI_MAP_FILE)) {
$filename = INTERWIKI_MAP_FILE;
Modified: trunk/lib/Request.php
===================================================================
--- trunk/lib/Request.php 2021-09-20 12:39:40 UTC (rev 10593)
+++ trunk/lib/Request.php 2021-09-20 12:47:14 UTC (rev 10594)
@@ -414,7 +414,7 @@
if (ob_get_length()) ob_clean();
$this->_is_buffering_output = false;
} else {
- trigger_error(_("Not buffering output"), E_USER_NOTICE);
+ trigger_error(_("Not buffering output"));
}
}
@@ -812,8 +812,7 @@
. "\n"
. sprintf(_("Please ensure that %s is writable, or redefine %s in config/config.ini."),
sprintf(_("the file “%s”"), ACCESS_LOG),
- 'ACCESS_LOG')
- , E_USER_NOTICE);
+ 'ACCESS_LOG'));
}
register_shutdown_function("Request_AccessLogEntry_shutdown_function");
Modified: trunk/lib/SemanticWeb.php
===================================================================
--- trunk/lib/SemanticWeb.php 2021-09-20 12:39:40 UTC (rev 10593)
+++ trunk/lib/SemanticWeb.php 2021-09-20 12:47:14 UTC (rev 10594)
@@ -330,8 +330,7 @@
$value = $val_base;
if (!is_numeric($value)) {
$this->workquery = ''; //must return false
- trigger_error("Cannot match against non-numeric attribute value $x := $ori_value",
- E_USER_NOTICE);
+ trigger_error("Cannot match against non-numeric attribute value $x := $ori_value");
return '';
}
Modified: trunk/lib/WikiDB.php
===================================================================
--- trunk/lib/WikiDB.php 2021-09-20 12:39:40 UTC (rev 10593)
+++ trunk/lib/WikiDB.php 2021-09-20 12:47:14 UTC (rev 10594)
@@ -557,7 +557,7 @@
($this,
$linked_page->getName(),
$lookbehind . $from . $lookahead, $to,
- true, true);
+ true);
}
// FIXME: Disabled to avoid recursive modification when renaming
// a page like 'PageFoo to 'PageFooTwo'
@@ -568,7 +568,7 @@
($this,
$linked_page->getName(),
$lookbehind . $from . $lookahead, $to,
- true, true);
+ true);
}
}
}
@@ -978,8 +978,7 @@
$pdata = $cache->get_versiondata($pagename, $latestversion);
if ($data['mtime'] < $pdata['mtime']) {
trigger_error(sprintf(_("%s: Date of new revision is %s"),
- $pagename, "'non-monotonic'"),
- E_USER_NOTICE);
+ $pagename, "'non-monotonic'"));
$data['orig_mtime'] = $data['mtime'];
$data['mtime'] = $pdata['mtime'];
}
@@ -1272,7 +1271,7 @@
return $backend->exists_link($this->_pagename, $link, $reversed);
//$cache = &$this->_wikidb->_cache;
// TODO: check cache if it is possible
- $iter = $this->getLinks($reversed, false);
+ $iter = $this->getLinks($reversed);
while ($page = $iter->next()) {
if ($page->getName() == $link)
return $page;
@@ -1420,7 +1419,7 @@
{
if ($this->_wikidb->readonly) {
if ((int)DEBUG) {
- trigger_error("readonly database", E_USER_NOTICE);
+ trigger_error("readonly database");
}
return;
}
Modified: trunk/lib/WikiGroup.php
===================================================================
--- trunk/lib/WikiGroup.php 2021-09-20 12:39:40 UTC (rev 10593)
+++ trunk/lib/WikiGroup.php 2021-09-20 12:47:14 UTC (rev 10594)
@@ -480,16 +480,13 @@
* Private method to take a WikiDB_Page and parse to determine if the
* current_user is a member of the group.
* @param object $group_page WikiDB_Page object for the group's page
- * @param bool $strict
* @return boolean True if user is a member, else false.
*/
- private function _inGroupPage($group_page, $strict = false)
+ private function _inGroupPage($group_page)
{
$group_revision = $group_page->getCurrentRevision();
if ($group_revision->hasDefaultContents()) {
$group = $group_page->getName();
- if ($strict) trigger_error(sprintf(_("Group page “%s” does not exist"), $group),
- E_USER_WARNING);
return false;
}
$contents = $group_revision->getContent();
@@ -935,7 +932,7 @@
$info = ldap_get_entries($ldap, $sr);
else {
$info = array('count' => 0);
- trigger_error("LDAP_SEARCH: base=\"$base_dn\" \"(cn=$group)\" failed", E_USER_NOTICE);
+ trigger_error("LDAP_SEARCH: base=\"$base_dn\" \"(cn=$group)\" failed");
}
$base_dn = (LDAP_OU_USERS ? LDAP_OU_USERS : "ou=Users")
. ($this->base_dn ? "," . $this->base_dn : '');
@@ -949,7 +946,7 @@
$members[] = $info2[$j]["cn"][0];
}
} else {
- trigger_error("LDAP_SEARCH: base=\"$base_dn\" \"(gidNumber=$gid)\" failed", E_USER_NOTICE);
+ trigger_error("LDAP_SEARCH: base=\"$base_dn\" \"(gidNumber=$gid)\" failed");
}
}
}
Modified: trunk/lib/WikiPlugin.php
===================================================================
--- trunk/lib/WikiPlugin.php 2021-09-20 12:39:40 UTC (rev 10593)
+++ trunk/lib/WikiPlugin.php 2021-09-20 12:47:14 UTC (rev 10594)
@@ -284,7 +284,7 @@
function handle_plugin_args_cruft($argstr, $args)
{
trigger_error(sprintf(_("trailing cruft in plugin args: “%s”"),
- $argstr), E_USER_NOTICE);
+ $argstr));
}
/* A plugin can override this to allow undeclared arguments.
@@ -293,7 +293,7 @@
function allow_undeclared_arg($name, $value)
{
trigger_error(sprintf(_("Argument “%s” not declared by plugin."),
- $name), E_USER_NOTICE);
+ $name));
return false;
}
Modified: trunk/lib/WikiPluginCached.php
===================================================================
--- trunk/lib/WikiPluginCached.php 2021-09-20 12:39:40 UTC (rev 10593)
+++ trunk/lib/WikiPluginCached.php 2021-09-20 12:47:14 UTC (rev 10594)
@@ -1097,7 +1097,7 @@
if (!$ok) {
trigger_error("\n" . $cmd . " failed: $errstr", E_USER_WARNING);
} elseif ($request->getArg('debug'))
- trigger_error("\n" . $cmd . ": success\n", E_USER_NOTICE);
+ trigger_error("\n" . $cmd . ": success\n");
if (!isWindows()) {
if ($until) {
$loop = 100000;
Modified: trunk/lib/WikiTheme.php
===================================================================
--- trunk/lib/WikiTheme.php 2021-09-20 12:39:40 UTC (rev 10593)
+++ trunk/lib/WikiTheme.php 2021-09-20 12:47:14 UTC (rev 10594)
@@ -301,7 +301,7 @@
if (isset($this->_default_theme)) {
return $this->_default_theme->_findFile($file, $missing_okay);
} elseif (!$missing_okay) {
- trigger_error("$this->_theme/$file: not found", E_USER_NOTICE);
+ trigger_error("$this->_theme/$file: not found");
if (DEBUG & _DEBUG_TRACE) {
echo "<pre>";
printSimpleTrace(debug_backtrace());
@@ -1309,8 +1309,7 @@
$request->_MoreHeaders[] = $element;
if (!empty($this->_headers_printed) and $this->_headers_printed) {
trigger_error(_("Some action(page) wanted to add more headers, but they were already printed.")
- . "\n" . $element->asXML(),
- E_USER_NOTICE);
+ . "\n" . $element->asXML());
}
}
Modified: trunk/lib/WikiUser.php
===================================================================
--- trunk/lib/WikiUser.php 2021-09-20 12:39:40 UTC (rev 10593)
+++ trunk/lib/WikiUser.php 2021-09-20 12:47:14 UTC (rev 10594)
@@ -1954,7 +1954,7 @@
if (!isset($this->_prefs[$name])) {
if ($name == 'passwd2') return false;
if ($name == 'passwd') return false;
- trigger_error("$name: unknown preference", E_USER_NOTICE);
+ trigger_error("$name: unknown preference");
return false;
}
return $this->_prefs[$name];
Modified: trunk/lib/XmlElement.php
===================================================================
--- trunk/lib/XmlElement.php 2021-09-20 12:39:40 UTC (rev 10593)
+++ trunk/lib/XmlElement.php 2021-09-20 12:47:14 UTC (rev 10594)
@@ -127,10 +127,9 @@
} elseif (is_array($item)) {
// DEPRECATED:
// Use XmlContent objects instead of arrays for collections of XmlElements.
- trigger_error("Passing arrays to printXML() is deprecated: (" . AsXML($item, true) . ")",
- E_USER_NOTICE);
+ trigger_error("Passing arrays to printXML() is deprecated: (" . AsXML($item, true) . ")");
foreach ($item as $x)
- $this->printXML($x);
+ $this->printXML();
} else {
echo $this->_quote((string)$item);
}
@@ -148,10 +147,9 @@
$xml .= $this->_quote($item->asString()); else
$xml .= sprintf("==Object(%s)==", get_class($item));
} elseif (is_array($item)) {
- trigger_error("Passing arrays to ->asXML() is deprecated: (" . AsXML($item, true) . ")",
- E_USER_NOTICE);
+ trigger_error("Passing arrays to ->asXML() is deprecated: (" . AsXML($item, true) . ")");
foreach ($item as $x)
- $xml .= $this->asXML($x);
+ $xml .= $this->asXML();
} else
$xml .= $this->_quote((string)$item);
}
@@ -622,8 +620,7 @@
} elseif (is_array($val)) {
// DEPRECATED:
// Use XmlContent objects instead of arrays for collections of XmlElements.
- trigger_error("Passing arrays to PrintXML() is deprecated: (" . AsXML($val, true) . ")",
- E_USER_NOTICE);
+ trigger_error("Passing arrays to PrintXML() is deprecated: (" . AsXML($val, true) . ")");
foreach ($val as $x)
PrintXML($x);
} else
@@ -650,8 +647,7 @@
// Use XmlContent objects instead of arrays for collections of XmlElements.
if (empty($nowarn)) {
$nowarn = true;
- trigger_error("Passing arrays to AsXML() is deprecated: (" . AsXML($val) . ")",
- E_USER_NOTICE);
+ trigger_error("Passing arrays to AsXML() is deprecated: (" . AsXML($val) . ")");
unset($nowarn);
}
$xml = '';
@@ -677,7 +673,7 @@
} elseif (is_array($val)) {
// DEPRECATED:
// Use XmlContent objects instead of arrays for collections of XmlElements.
- trigger_error("Passing arrays to AsString() is deprecated", E_USER_NOTICE);
+ trigger_error("Passing arrays to AsString() is deprecated");
$str = '';
foreach ($val as $x)
$str .= AsString($x);
Modified: trunk/lib/diff.php
===================================================================
--- trunk/lib/diff.php 2021-09-20 12:39:40 UTC (rev 10593)
+++ trunk/lib/diff.php 2021-09-20 12:47:14 UTC (rev 10594)
@@ -286,7 +286,7 @@
$html = HTML::div(array('class' => 'wikitext', 'id' => 'difftext'),
HTML::p(fmt("Page “%s” does not exist.", WikiLink($pagename, 'unknown'))));
require_once 'lib/Template.php';
- GeneratePage($html, sprintf(_("Diff: %s"), $pagename), false);
+ GeneratePage($html, sprintf(_("Diff: %s"), $pagename));
return; //early return
}
@@ -362,7 +362,7 @@
$html->pushContent(HTML::table(PageInfoRow(_("Newer page:"), $new,
$request, empty($version)),
PageInfoRow(_("Older page:"), $old,
- $request, false)));
+ $request)));
if ($new && $old) {
$diff = new Diff($old->getContent(), $new->getContent());
Modified: trunk/lib/loadsave.php
===================================================================
--- trunk/lib/loadsave.php 2021-09-20 12:39:40 UTC (rev 10593)
+++ trunk/lib/loadsave.php 2021-09-20 12:47:14 UTC (rev 10594)
@@ -1155,8 +1155,7 @@
}
if (!empty($error_html))
- trigger_error(_("Default InterWiki map file not loaded.")
- . $error_html, E_USER_NOTICE);
+ trigger_error(_("Default InterWiki map file not loaded.") . $error_html);
if ($goback)
return $content;
Modified: trunk/lib/main.php
===================================================================
--- trunk/lib/main.php 2021-09-20 12:39:40 UTC (rev 10593)
+++ trunk/lib/main.php 2021-09-20 12:47:14 UTC (rev 10594)
@@ -961,7 +961,7 @@
return $en_action;
}
- trigger_error("$action: Unknown action", E_USER_NOTICE);
+ trigger_error("$action: Unknown action");
return 'browse';
}
@@ -1070,7 +1070,7 @@
return $cache[$action] = $action;
}
- trigger_error("$action: Cannot find action page", E_USER_NOTICE);
+ trigger_error("$action: Cannot find action page");
return $cache[$action] = false;
}
@@ -1378,14 +1378,12 @@
'SESSION_SAVE_PATH')
. "\n"
. sprintf(_("Attempting to use the directory “%s” instead."),
- $tmpdir)
- , E_USER_NOTICE);
+ $tmpdir));
if (!is_writeable($tmpdir)) {
trigger_error
(sprintf(_("%s is not writable."), $tmpdir)
. "\n"
- . _("Users will not be able to sign in.")
- , E_USER_NOTICE);
+ . _("Users will not be able to sign in."));
} else
@ini_set('session.save_path', $tmpdir);
}
Modified: trunk/lib/plugin/SystemInfo.php
===================================================================
--- trunk/lib/plugin/SystemInfo.php 2021-09-20 12:39:40 UTC (rev 10593)
+++ trunk/lib/plugin/SystemInfo.php 2021-09-20 12:47:14 UTC (rev 10594)
@@ -155,7 +155,7 @@
global $request;
$dbi = $request->getDbh();
$s = sprintf(_("%d pages"), $dbi->numPages(true));
- $s .= ", " . sprintf(_("%d not-empty pages"), $dbi->numPages(false));
+ $s .= ", " . sprintf(_("%d not-empty pages"), $dbi->numPages());
// more bla....
// $s .= ", " . sprintf(_("earliest page from %s"), $earliestdate);
// $s .= ", " . sprintf(_("latest page from %s"), $latestdate);
@@ -199,8 +199,7 @@
// TODO: see WhoIsOnline hit stats, and sql accesslogs
function accessstats()
{
- $s = _("not yet");
- return $s;
+ return _("not yet");
}
// numeric array
Modified: trunk/lib/prepend.php
===================================================================
--- trunk/lib/prepend.php 2021-09-20 12:39:40 UTC (rev 10593)
+++ trunk/lib/prepend.php 2021-09-20 12:47:14 UTC (rev 10594)
@@ -100,7 +100,7 @@
{
if (!isset($this->_times)) {
// posix_times() not available.
- return sprintf("real: %.3f", $this->getTime('real'));
+ return sprintf("real: %.3f", $this->getTime());
}
$now = posix_times();
return sprintf("real: %.3f, user: %.3f, sys: %.3f",
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|