|
From: <var...@us...> - 2021-12-02 11:09:31
|
Revision: 10720
http://sourceforge.net/p/phpwiki/code/10720
Author: vargenau
Date: 2021-12-02 11:09:30 +0000 (Thu, 02 Dec 2021)
Log Message:
-----------
FileInfo plugin: test argument quiet is a boolean
Modified Paths:
--------------
trunk/lib/plugin/FileInfo.php
Modified: trunk/lib/plugin/FileInfo.php
===================================================================
--- trunk/lib/plugin/FileInfo.php 2021-12-02 10:56:16 UTC (rev 10719)
+++ trunk/lib/plugin/FileInfo.php 2021-12-02 11:09:30 UTC (rev 10720)
@@ -82,12 +82,25 @@
{
$args = $this->getArgs($argstr, $request);
extract($args);
- if (!$file) {
+
+ if (empty($file)) {
return $this->error(sprintf(_("A required argument “%s” is missing."), 'file'));
}
- if (!$display) {
+
+ if (empty($display)) {
return $this->error(sprintf(_("A required argument “%s” is missing."), 'display'));
}
+
+ 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"));
+ }
+ }
+
$is_Upload = false;
if (string_starts_with($file, "Upload:")) {
$file = preg_replace("/^Upload:(.*)$/", getUploadFilePath() . "\\1", $file);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|