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. |