From: <var...@us...> - 2009-02-27 03:11:56
|
Revision: 6592 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6592&view=rev Author: vargenau Date: 2009-02-27 03:11:51 +0000 (Fri, 27 Feb 2009) Log Message: ----------- Return HTML Modified Paths: -------------- trunk/lib/plugin/FileInfo.php Modified: trunk/lib/plugin/FileInfo.php =================================================================== --- trunk/lib/plugin/FileInfo.php 2009-02-27 02:55:51 UTC (rev 6591) +++ trunk/lib/plugin/FileInfo.php 2009-02-27 03:11:51 UTC (rev 6592) @@ -2,6 +2,7 @@ rcs_id('$Id$'); /* Copyright 2005,2007 $ThePhpWikiProgrammingTeam + Copyright 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent This file is part of PhpWiki. @@ -40,7 +41,7 @@ } function getDescription () { - return _("Display file information like version,size,date,... of uploaded files."); + return _("Display file information like version, size, date... of uploaded files."); } function getVersion() { @@ -74,10 +75,11 @@ chdir(PHPWIKI_DIR); } if (!file_exists($file)) { - if ($quiet) - return ''; - else - trigger_error("file \"$file\" not found", E_USER_WARNING); + if ($quiet) { + return HTML::raw(''); + } else { + return $this->error(sprintf(_("File '%s' not found."), $file)); + } } // sanify $file name $realfile = realpath($file); @@ -123,9 +125,11 @@ } break; default: - if (!$quiet) + if (!$quiet) { return $this->error(sprintf(_("Unsupported argument: %s=%s"), 'display', $mode)); - else return ''; + } else { + return HTML::raw(''); + } break; } } @@ -141,7 +145,7 @@ require_once("lib/InlineParser.php"); return TransformInline($result, 2, $basepage); } else { - return $result; + return HTML::raw($result); } } @@ -309,29 +313,6 @@ } }; -/* - $Log: not supported by cvs2svn $ - Revision 1.8 2008/05/17 06:26:57 vargenau - Check PHPWIKI_DIR is defined - - Revision 1.7 2007/08/25 18:06:05 rurban - fix Upload: links - - Revision 1.6 2007/01/04 16:42:31 rurban - Add quiet argument. Allow local files if owner == ADMIN and page == locked. - - Revision 1.5 2006/08/25 22:10:16 rurban - fix docs: FileVersion => FileInfo - - Revision 1.4 2005/10/29 14:18:47 rurban - add display=phonysize - - Revision 1.3 2005/10/29 13:35:00 rurban - fix Log:, add chdir() if not in PHPWIKI_DIR, fix ->warning - - -*/ - // For emacs users // Local Variables: // mode: php This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2012-12-27 18:07:12
|
Revision: 8694 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8694&view=rev Author: vargenau Date: 2012-12-27 18:07:00 +0000 (Thu, 27 Dec 2012) Log Message: ----------- Remove unreachable statement Modified Paths: -------------- trunk/lib/plugin/FileInfo.php Modified: trunk/lib/plugin/FileInfo.php =================================================================== --- trunk/lib/plugin/FileInfo.php 2012-12-27 18:04:37 UTC (rev 8693) +++ trunk/lib/plugin/FileInfo.php 2012-12-27 18:07:00 UTC (rev 8694) @@ -231,7 +231,6 @@ if (function_exists('res_list_type') or loadPhpExtension('win32std')) return $this->exeversion_resopen($file); return exeversion_showver($file); - return ''; } // http://www.codeproject.com/dll/showver.asp This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-11-30 16:55:11
|
Revision: 10712 http://sourceforge.net/p/phpwiki/code/10712 Author: vargenau Date: 2021-11-30 16:55:09 +0000 (Tue, 30 Nov 2021) Log Message: ----------- FileInfo plugin: better format for date Modified Paths: -------------- trunk/lib/plugin/FileInfo.php Modified: trunk/lib/plugin/FileInfo.php =================================================================== --- trunk/lib/plugin/FileInfo.php 2021-11-30 12:29:40 UTC (rev 10711) +++ trunk/lib/plugin/FileInfo.php 2021-11-30 16:55:09 UTC (rev 10712) @@ -117,7 +117,7 @@ $s[] = $this->phonysize(filesize($file)); break; case 'date': - $s[] = strftime("%x %X", filemtime($file)); + $s[] = strftime("%Y-%m-%d %T", filemtime($file)); break; case 'mtime': $s[] = filemtime($file); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-12-02 10:56:18
|
Revision: 10719 http://sourceforge.net/p/phpwiki/code/10719 Author: vargenau Date: 2021-12-02 10:56:16 +0000 (Thu, 02 Dec 2021) Log Message: ----------- FileInfo plugin: always define $is_Upload Modified Paths: -------------- trunk/lib/plugin/FileInfo.php Modified: trunk/lib/plugin/FileInfo.php =================================================================== --- trunk/lib/plugin/FileInfo.php 2021-12-01 16:39:02 UTC (rev 10718) +++ trunk/lib/plugin/FileInfo.php 2021-12-02 10:56:16 UTC (rev 10719) @@ -88,9 +88,10 @@ if (!$display) { return $this->error(sprintf(_("A required argument “%s” is missing."), 'display')); } + $is_Upload = false; if (string_starts_with($file, "Upload:")) { $file = preg_replace("/^Upload:(.*)$/", getUploadFilePath() . "\\1", $file); - $is_Upload = 1; + $is_Upload = true; } $dir = getcwd(); if (defined('PHPWIKI_DIR')) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |