From: <var...@us...> - 2008-09-05 16:35:04
|
Revision: 6235 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6235&view=rev Author: vargenau Date: 2008-09-05 16:35:14 +0000 (Fri, 05 Sep 2008) Log Message: ----------- Nice alert boxes for upload Modified Paths: -------------- trunk/lib/plugin/UpLoad.php Modified: trunk/lib/plugin/UpLoad.php =================================================================== --- trunk/lib/plugin/UpLoad.php 2008-09-05 15:18:45 UTC (rev 6234) +++ trunk/lib/plugin/UpLoad.php 2008-09-05 16:35:14 UTC (rev 6235) @@ -2,6 +2,7 @@ rcs_id('$Id$'); /* Copyright 2003,2004,2007 $ThePhpWikiProgrammingTeam + Copyright 2008 Marc-Etienne Vargenau, Alcatel-Lucent This file is part of PhpWiki. @@ -28,6 +29,7 @@ * Author: NathanGass <ga...@io...> * Changes: ReiniUrban <ru...@x-...>, * qubit <rt...@da...> + * Marc-Etienne Vargenau, Alcatel-Lucent * Note: See also Jochen Kalmbach's plugin/UserFileManagement.php */ @@ -137,7 +139,7 @@ extract($args); $file_dir = getUploadFilePath(); - $file_dir .= "/"; + $file_dir .= "/"; $form = HTML::form(array('action' => $request->getPostURL(), 'enctype' => 'multipart/form-data', 'method' => 'post')); @@ -168,8 +170,20 @@ // Make sure that the user is logged in. $user = $request->getUser(); if (!$user->isAuthenticated()) { - $message->pushContent(HTML::h2(_("ACCESS DENIED: You must log in to upload files.")), - HTML::br(),HTML::br()); + global $WikiTheme; + if (isa($WikiTheme, 'Theme_gforge')) { + $message->pushContent(HTML::div(array('class' => 'error'), + HTML::p(_("You cannot upload files.")), + HTML::ul( + HTML::li(_("Check you are logged in.")), + HTML::li(_("Check you are in the right project.")), + HTML::li(_("Check you are a member of the current project.")) + ) + )); + } else { + $message->pushContent(HTML::div(array('class' => 'error'), + HTML::p(_("ACCESS DENIED: You must log in to upload files.")))); + } $result = HTML(); $result->pushContent($form); $result->pushContent($message); @@ -192,36 +206,36 @@ } $u_userfile = preg_replace("/ /", "%20", $u_userfile); $userfile_tmpname = $userfile->getTmpName(); - $err_header = HTML::h2(fmt("ERROR uploading '%s': ", $userfile_name)); + $err_header = HTML::div(array('class' => 'error'), + HTML::p(fmt("ERROR uploading '%s'", $userfile_name))); if (preg_match("/(\." . join("|\.", $this->disallowed_extensions) . ")(\.|\$)/i", $userfile_name)) { $message->pushContent($err_header); - $message->pushContent(fmt("Files with extension %s are not allowed.", - join(", ", $this->disallowed_extensions)),HTML::br(),HTML::br()); + $message->pushContent(HTML::p(fmt("Files with extension %s are not allowed.", + join(", ", $this->disallowed_extensions)))); } elseif (! DISABLE_UPLOAD_ONLY_ALLOWED_EXTENSIONS and ! preg_match("/(\." . join("|\.", $this->allowed_extensions) . ")\$/i", $userfile_name)) { $message->pushContent($err_header); - $message->pushContent(fmt("Only files with the extension %s are allowed.", - join(", ", $this->allowed_extensions)),HTML::br(),HTML::br()); + $message->pushContent(HTML::p(fmt("Only files with the extension %s are allowed.", + join(", ", $this->allowed_extensions)))); } elseif (preg_match("/[^._a-zA-Z0-9- ]/", $userfile_name)) { $message->pushContent($err_header); - $message->pushContent(_("Invalid filename. File names may only contain alphanumeric characters and dot, underscore, space or dash."), - HTML::br(),HTML::br()); + $message->pushContent(HTML::p(_("Invalid filename. File names may only contain alphanumeric characters and dot, underscore, space or dash."))); } elseif (file_exists($file_dir . $userfile_name)) { $message->pushContent($err_header); - $message->pushContent(fmt("There is already a file with name %s uploaded.", - $u_userfile),HTML::br(),HTML::br()); + $message->pushContent(HTML::p(fmt("There is already a file with name %s uploaded.", + $u_userfile))); } elseif ($userfile->getSize() > (MAX_UPLOAD_SIZE)) { $message->pushContent($err_header); - $message->pushContent(_("Sorry but this file is too big."),HTML::br(),HTML::br()); + $message->pushContent(HTML::p(_("Sorry but this file is too big."))); } elseif (move_uploaded_file($userfile_tmpname, $file_dir . $userfile_name) or (IsWindows() and rename($userfile_tmpname, $file_dir . $userfile_name)) @@ -229,8 +243,9 @@ { $interwiki = new PageType_interwikimap(); $link = $interwiki->link("Upload:$u_userfile"); - $message->pushContent(HTML::h2(_("File successfully uploaded."))); - $message->pushContent(HTML::ul(HTML::li($link))); + $message->pushContent(HTML::div(array('class' => 'feedback'), + HTML::p(_("File successfully uploaded.")), + HTML::p($link))); // the upload was a success and we need to mark this event in the "upload log" if ($logfile) { @@ -250,12 +265,12 @@ $pagehandle->save($newtext, $version + 1, $meta); } } - } - else { + } else { $message->pushContent($err_header); $message->pushContent(HTML::br(),_("Uploading failed."),HTML::br()); } - } else { + } + else { $message->pushContent(HTML::br(),_("No file selected. Please select one."),HTML::br()); } @@ -294,140 +309,6 @@ } -// $Log: not supported by cvs2svn $ -// Revision 1.30 2008/08/03 17:25:41 vargenau -// Add message: "No file selected. Please select one." -// -// Revision 1.29 2008/08/03 17:06:32 vargenau -// Add Open Document Format suffixes: odg, odp, ods, odt -// -// Revision 1.28 2008/08/03 15:14:55 vargenau -// Add slash to file_dir -// -// Revision 1.27 2008/05/17 06:53:54 vargenau -// Create log file if it does not exist -// -// Revision 1.26 2007/07/14 12:05:07 rurban -// no inlined [] links anymore, edit inclusion, more extensions allowed. -// -// Revision 1.25 2007/04/18 20:40:48 rurban -// added DISABLE_UPLOAD_ONLY_ALLOWED_EXTENSIONS -// -// Revision 1.24 2007/04/11 17:49:01 rurban -// Chgeck against .php\d, i.e. php3 -// -// Revision 1.23 2007/04/08 12:43:45 rurban -// Important security fix! -// Disallow files like "deface.php.3" also. Those are actually in the wild! -// -// Revision 1.22 2007/02/17 14:16:56 rurban -// allow spaces in filenames -// -// Revision 1.21 2007/01/04 16:46:50 rurban -// Support UPLOAD_USERDIR -// -// Revision 1.20 2006/08/15 13:40:40 rurban -// help finding the file (should not be needed) -// -// Revision 1.19 2005/04/11 19:40:15 rurban -// Simplify upload. See https://sourceforge.net/forum/message.php?msg_id=3093651 -// Improve UpLoad warnings. -// Move auth check before upload. -// -// Revision 1.18 2005/02/12 17:24:24 rurban -// locale update: missing . : fixed. unified strings -// proper linebreaks -// -// Revision 1.17 2004/11/09 08:15:50 rurban -// trim filename -// -// Revision 1.16 2004/10/21 19:03:37 rurban -// Be more stricter with uploads: Filenames may only contain alphanumeric -// characters. Patch #1037825 -// -// Revision 1.15 2004/09/22 13:46:26 rurban -// centralize upload paths. -// major WikiPluginCached feature enhancement: -// support _STATIC pages in uploads/ instead of dynamic getimg.php? subrequests. -// mainly for debugging, cache problems and action=pdf -// -// Revision 1.14 2004/06/16 10:38:59 rurban -// Disallow refernces in calls if the declaration is a reference -// ("allow_call_time_pass_reference clean"). -// PhpWiki is now allow_call_time_pass_reference = Off clean, -// but several external libraries may not. -// In detail these libs look to be affected (not tested): -// * Pear_DB odbc -// * adodb oracle -// -// Revision 1.13 2004/06/14 11:31:39 rurban -// renamed global $Theme to $WikiTheme (gforge nameclash) -// inherit PageList default options from PageList -// default sortby=pagename -// use options in PageList_Selectable (limit, sortby, ...) -// added action revert, with button at action=diff -// added option regex to WikiAdminSearchReplace -// -// Revision 1.12 2004/06/13 11:34:22 rurban -// fixed bug #969532 (space in uploaded filenames) -// improved upload error messages -// -// Revision 1.11 2004/06/11 09:07:30 rurban -// support theme-specific LinkIconAttr: front or after or none -// -// Revision 1.10 2004/04/12 10:19:18 rurban -// fixed copyright year -// -// Revision 1.9 2004/04/12 10:18:22 rurban -// removed the hairy regex line -// -// Revision 1.8 2004/04/12 09:12:22 rurban -// fix syntax errors -// -// Revision 1.7 2004/04/09 17:49:03 rurban -// Added PhpWiki RssFeed to Sidebar -// sidebar formatting -// some browser dependant fixes (old-browser support) -// -// Revision 1.6 2004/02/27 01:36:51 rurban -// autolink enabled -// -// Revision 1.5 2004/02/27 01:24:43 rurban -// use IntwerWiki links for uploaded file. -// autolink to page prepared, but not yet ready -// -// Revision 1.4 2004/02/21 19:12:59 rurban -// patch by Sascha Carlin -// -// Revision 1.3 2004/02/17 12:11:36 rurban -// added missing 4th basepage arg at plugin->run() to almost all plugins. This caused no harm so far, because it was silently dropped on normal usage. However on plugin internal ->run invocations it failed. (InterWikiSearch, IncludeSiteMap, ...) -// -// Revision 1.2 2004/01/26 09:18:00 rurban -// * changed stored pref representation as before. -// the array of objects is 1) bigger and 2) -// less portable. If we would import packed pref -// objects and the object definition was changed, PHP would fail. -// This doesn't happen with an simple array of non-default values. -// * use $prefs->retrieve and $prefs->store methods, where retrieve -// understands the interim format of array of objects also. -// * simplified $prefs->get() and fixed $prefs->set() -// * added $user->_userid and class '_WikiUser' portability functions -// * fixed $user object ->_level upgrading, mostly using sessions. -// this fixes yesterdays problems with loosing authorization level. -// * fixed WikiUserNew::checkPass to return the _level -// * fixed WikiUserNew::isSignedIn -// * added explodePageList to class PageList, support sortby arg -// * fixed UserPreferences for WikiUserNew -// * fixed WikiPlugin for empty defaults array -// * UnfoldSubpages: added pagename arg, renamed pages arg, -// removed sort arg, support sortby arg -// -// Revision 1.1 2003/11/04 18:41:41 carstenklapp -// New plugin which was submitted to the mailing list some time -// ago. (This is the best UpLoad function I have seen for PhpWiki so -// far. Cleaned up text formatting and typos from the version on the -// mailing list. Still needs a few adjustments.) - // (c-file-style: "gnu") // 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...> - 2008-10-30 16:55:21
|
Revision: 6340 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6340&view=rev Author: vargenau Date: 2008-10-30 16:55:09 +0000 (Thu, 30 Oct 2008) Log Message: ----------- Add xml and xsd extensions Modified Paths: -------------- trunk/lib/plugin/UpLoad.php Modified: trunk/lib/plugin/UpLoad.php =================================================================== --- trunk/lib/plugin/UpLoad.php 2008-10-30 11:08:19 UTC (rev 6339) +++ trunk/lib/plugin/UpLoad.php 2008-10-30 16:55:09 UTC (rev 6340) @@ -94,6 +94,8 @@ tar.gz txt xls +xml +xsd zip"); $this->disallowed_extensions = explode("\n", "ad[ep] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-06-12 14:35:50
|
Revision: 6931 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6931&view=rev Author: vargenau Date: 2009-06-12 14:35:49 +0000 (Fri, 12 Jun 2009) Log Message: ----------- Allow docx, pptx, xlsx (Open XML) Modified Paths: -------------- trunk/lib/plugin/UpLoad.php Modified: trunk/lib/plugin/UpLoad.php =================================================================== --- trunk/lib/plugin/UpLoad.php 2009-06-12 14:08:36 UTC (rev 6930) +++ trunk/lib/plugin/UpLoad.php 2009-06-12 14:35:49 UTC (rev 6931) @@ -2,7 +2,7 @@ rcs_id('$Id$'); /* Copyright 2003,2004,2007 $ThePhpWikiProgrammingTeam - Copyright 2008 Marc-Etienne Vargenau, Alcatel-Lucent + Copyright 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent This file is part of PhpWiki. @@ -74,6 +74,7 @@ cfg diff doc +docx gif h ini @@ -89,11 +90,13 @@ pdf png ppt +pptx rar tar tar.gz txt xls +xlsx xml xsd zip"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2022-01-03 10:48:44
|
Revision: 10807 http://sourceforge.net/p/phpwiki/code/10807 Author: vargenau Date: 2022-01-03 10:48:42 +0000 (Mon, 03 Jan 2022) Log Message: ----------- UpLoad plugin: add HTML header to log file Modified Paths: -------------- trunk/lib/plugin/UpLoad.php Modified: trunk/lib/plugin/UpLoad.php =================================================================== --- trunk/lib/plugin/UpLoad.php 2022-01-02 14:40:53 UTC (rev 10806) +++ trunk/lib/plugin/UpLoad.php 2022-01-03 10:48:42 UTC (rev 10807) @@ -260,11 +260,23 @@ global $request; $user = $request->_user; + $empty_log = !file_exists($upload_log); if (file_exists($upload_log) and (!is_writable($upload_log))) { trigger_error(_("The upload logfile exists but is not writable."), E_USER_WARNING); } elseif (!$log_handle = fopen($upload_log, "a")) { trigger_error(_("Can't open the upload logfile."), E_USER_WARNING); - } else { // file size in KB; precision of 0.1 + } else { + if ($empty_log) { + fwrite($log_handle, + "<!DOCTYPE html>\n" + . '<html xml:lang="en" lang="en">'."\n" + . "<head>\n" + . "<title>PhpWiki - UpLoad logfile</title>\n" + . "</head>\n" + . "<body>\n" + . "<table>\n"); + } + // file size in KB; precision of 0.1 $file_size = round(($userfile->getSize()) / 1024, 1); if ($file_size <= 0) { $file_size = "< 0.1"; @@ -271,11 +283,10 @@ } $userfile_name = $userfile->getName(); fwrite($log_handle, - "\n" - . "<tr><td><a href=\"$userfile_name\">$userfile_name</a></td>" - . "<td class=\"align-right\">$file_size kB</td>" - . "<td> " . $WikiTheme->formatDate(time()) . "</td>" - . "<td> <em>" . $user->getId() . "</em></td></tr>"); + "<tr>\n <td><a href=\"$userfile_name\">$userfile_name</a></td>\n" + . " <td class=\"align-right\">$file_size kB</td>\n" + . " <td> " . $WikiTheme->formatDate(time()) . "</td>\n" + . " <td> <em>" . $user->getId() . "</em></td>\n</tr>\n"); fclose($log_handle); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-07-16 08:42:44
|
Revision: 7041 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7041&view=rev Author: vargenau Date: 2009-07-16 08:42:16 +0000 (Thu, 16 Jul 2009) Log Message: ----------- Allow "ics" as extension Modified Paths: -------------- trunk/lib/plugin/UpLoad.php Modified: trunk/lib/plugin/UpLoad.php =================================================================== --- trunk/lib/plugin/UpLoad.php 2009-07-15 16:06:33 UTC (rev 7040) +++ trunk/lib/plugin/UpLoad.php 2009-07-16 08:42:16 UTC (rev 7041) @@ -77,6 +77,7 @@ docx gif h +ics ini jpeg jpg This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-09-24 19:42:49
|
Revision: 7157 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7157&view=rev Author: vargenau Date: 2009-09-24 19:42:39 +0000 (Thu, 24 Sep 2009) Log Message: ----------- Allow FLV as extension Modified Paths: -------------- trunk/lib/plugin/UpLoad.php Modified: trunk/lib/plugin/UpLoad.php =================================================================== --- trunk/lib/plugin/UpLoad.php 2009-09-24 19:39:02 UTC (rev 7156) +++ trunk/lib/plugin/UpLoad.php 2009-09-24 19:42:39 UTC (rev 7157) @@ -75,6 +75,7 @@ diff doc docx +flv gif h ics This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2012-11-14 16:07:26
|
Revision: 8445 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8445&view=rev Author: vargenau Date: 2012-11-14 16:07:15 +0000 (Wed, 14 Nov 2012) Log Message: ----------- message --> err_header Modified Paths: -------------- trunk/lib/plugin/UpLoad.php Modified: trunk/lib/plugin/UpLoad.php =================================================================== --- trunk/lib/plugin/UpLoad.php 2012-11-14 16:05:45 UTC (rev 8444) +++ trunk/lib/plugin/UpLoad.php 2012-11-14 16:07:15 UTC (rev 8445) @@ -217,26 +217,25 @@ if (preg_match("/(\." . join("|\.", $this->disallowed_extensions) . ")(\.|\$)/i", $userfile_name) ) { - $message->pushContent($err_header); - $message->pushContent(HTML::p(fmt("Files with extension %s are not allowed.", + $err_header->pushContent(HTML::p(fmt("Files with extension %s are not allowed.", join(", ", $this->disallowed_extensions)))); + $message->pushContent($err_header); } elseif (!DISABLE_UPLOAD_ONLY_ALLOWED_EXTENSIONS and !preg_match("/(\." . join("|\.", $this->allowed_extensions) . ")\$/i", $userfile_name) ) { - $message->pushContent($err_header); - $message->pushContent(HTML::p(fmt("Only files with the extension %s are allowed.", + $err_header->pushContent(HTML::p(fmt("Only files with the extension %s are allowed.", join(", ", $this->allowed_extensions)))); + $message->pushContent($err_header); } elseif (preg_match("/[^._a-zA-Z0-9- ]/", strip_accents($userfile_name))) { + $err_header->pushContent(HTML::p(_("Invalid filename. File names may only contain alphanumeric characters and dot, underscore, space or dash."))); $message->pushContent($err_header); - $message->pushContent(HTML::p(_("Invalid filename. File names may only contain alphanumeric characters and dot, underscore, space or dash."))); } elseif (file_exists($file_dir . $userfile_name)) { + $err_header->pushContent(HTML::p(fmt("There is already a file with name %s uploaded.", $u_userfile))); $message->pushContent($err_header); - $message->pushContent(HTML::p(fmt("There is already a file with name %s uploaded.", - $u_userfile))); } elseif ($userfile->getSize() > (MAX_UPLOAD_SIZE)) { + $err_header->pushContent(HTML::p(_("Sorry but this file is too big."))); $message->pushContent($err_header); - $message->pushContent(HTML::p(_("Sorry but this file is too big."))); } elseif (move_uploaded_file($userfile_tmpname, $file_dir . $userfile_name) or (IsWindows() and rename($userfile_tmpname, $file_dir . $userfile_name)) ) { @@ -265,8 +264,8 @@ } } } else { + $err_header->pushContent(HTML::p(_("Uploading failed."))); $message->pushContent($err_header); - $message->pushContent(HTML::br(), _("Uploading failed."), HTML::br()); } } else { $message->pushContent(HTML::br(), _("No file selected. Please select one."), HTML::br()); @@ -303,7 +302,6 @@ } return; } - } // Local Variables: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2013-09-24 16:29:07
|
Revision: 8842 http://sourceforge.net/p/phpwiki/code/8842 Author: vargenau Date: 2013-09-24 16:29:03 +0000 (Tue, 24 Sep 2013) Log Message: ----------- No %20 in file name Modified Paths: -------------- trunk/lib/plugin/UpLoad.php Modified: trunk/lib/plugin/UpLoad.php =================================================================== --- trunk/lib/plugin/UpLoad.php 2013-09-24 16:27:03 UTC (rev 8841) +++ trunk/lib/plugin/UpLoad.php 2013-09-24 16:29:03 UTC (rev 8842) @@ -208,7 +208,7 @@ $u_userfile = preg_replace("/ /", "%20", $u_userfile); $userfile_tmpname = $userfile->getTmpName(); $err_header = HTML::div(array('class' => 'error'), - HTML::p(fmt("ERROR uploading “%s”", $userfile_name))); + HTML::p(fmt("Error uploading “%s”", $userfile_name))); if (preg_match("/(\." . join("|\.", $this->disallowed_extensions) . ")(\.|\$)/i", $userfile_name) ) { @@ -226,7 +226,7 @@ $err_header->pushContent(HTML::p(_("Invalid filename. File names may only contain alphanumeric characters and dot, underscore, space or dash."))); $message->pushContent($err_header); } elseif (file_exists($file_dir . $userfile_name)) { - $err_header->pushContent(HTML::p(fmt("There is already a file with name %s uploaded.", $u_userfile))); + $err_header->pushContent(HTML::p(fmt("There is already a file with name “%s” uploaded.", $userfile_name))); $message->pushContent($err_header); } elseif ($userfile->getSize() > (MAX_UPLOAD_SIZE)) { $err_header->pushContent(HTML::p(_("Sorry but this file is too big."))); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-10-14 08:42:26
|
Revision: 9254 http://sourceforge.net/p/phpwiki/code/9254 Author: vargenau Date: 2014-10-14 08:42:22 +0000 (Tue, 14 Oct 2014) Log Message: ----------- Better use comma as separator (more readable) Modified Paths: -------------- trunk/lib/plugin/UpLoad.php Modified: trunk/lib/plugin/UpLoad.php =================================================================== --- trunk/lib/plugin/UpLoad.php 2014-10-13 16:45:39 UTC (rev 9253) +++ trunk/lib/plugin/UpLoad.php 2014-10-14 08:42:22 UTC (rev 9254) @@ -66,82 +66,15 @@ */ function run($dbi, $argstr, &$request, $basepage) { - $this->allowed_extensions = explode("\n", - "7z -avi -bmp -bz2 -c -cfg -diff -doc -docx -flv -gif -h -ics -ini -jpeg -jpg -kmz -mp3 -odg -odp -ods -odt -ogg -patch -pdf -png -ppt -pptx -rar -svg -tar -tar.gz -txt -xls -xlsx -xml -xsd -zip"); - $this->disallowed_extensions = explode("\n", - "ad[ep] -asd -ba[st] -chm -cmd -com -cgi -cpl -crt -dll -eml -exe -hlp -hta -in[fs] -isp -jse? -lnk -md[betw] -ms[cipt] -nws -ocx -ops -pcd -p[ir]f -php\d? -phtml -pl -py -reg -sc[frt] -sh[bsm]? -url -vb[esx]? -vxd -ws[cfh]"); + $this->allowed_extensions = explode(",", + "7z,avi,bmp,bz2,c,cfg,diff,doc,docx,flv,gif,h,ics,ini,". + "jpeg,jpg,kmz,mp3,odg,odp,ods,odt,ogg,patch,pdf,png,ppt," + "pptx,rar,svg,tar,tar.gz,txt,xls,xlsx,xml,xsd,zip"); + $this->disallowed_extensions = explode(",", + "ad[ep],asd,ba[st],chm,cmd,com,cgi,cpl,crt,dll,eml,exe,". + "hlp,hta,in[fs],isp,jse?,lnk,md[betw],ms[cipt],nws,ocx,". + "ops,pcd,p[ir]f,php\d?,phtml,pl,py,reg,sc[frt],sh[bsm]?,". + "url,vb[esx]?,vxd,ws[cfh]"); //removed "\{[[:xdigit:]]{8}(?:-[[:xdigit:]]{4}){3}-[[:xdigit:]]{12}\}" $args = $this->getArgs($argstr, $request); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-10-14 08:56:03
|
Revision: 9256 http://sourceforge.net/p/phpwiki/code/9256 Author: vargenau Date: 2014-10-14 08:56:00 +0000 (Tue, 14 Oct 2014) Log Message: ----------- Fix syntax Modified Paths: -------------- trunk/lib/plugin/UpLoad.php Modified: trunk/lib/plugin/UpLoad.php =================================================================== --- trunk/lib/plugin/UpLoad.php 2014-10-14 08:44:25 UTC (rev 9255) +++ trunk/lib/plugin/UpLoad.php 2014-10-14 08:56:00 UTC (rev 9256) @@ -68,7 +68,7 @@ { $this->allowed_extensions = explode(",", "7z,avi,bmp,bz2,c,cfg,diff,doc,docx,flv,gif,h,ics,ini,". - "jpeg,jpg,kmz,mp3,odg,odp,ods,odt,ogg,patch,pdf,png,ppt," + "jpeg,jpg,kmz,mp3,odg,odp,ods,odt,ogg,patch,pdf,png,ppt,". "pptx,rar,svg,tar,tar.gz,txt,xls,xlsx,xml,xsd,zip"); $this->disallowed_extensions = explode(",", "ad[ep],asd,ba[st],chm,cmd,com,cgi,cpl,crt,dll,eml,exe,". This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2016-01-16 16:28:19
|
Revision: 9763 http://sourceforge.net/p/phpwiki/code/9763 Author: vargenau Date: 2016-01-16 16:28:16 +0000 (Sat, 16 Jan 2016) Log Message: ----------- Upload plugin: put date and author in history Modified Paths: -------------- trunk/lib/plugin/UpLoad.php Modified: trunk/lib/plugin/UpLoad.php =================================================================== --- trunk/lib/plugin/UpLoad.php 2016-01-11 20:10:12 UTC (rev 9762) +++ trunk/lib/plugin/UpLoad.php 2016-01-16 16:28:16 UTC (rev 9763) @@ -227,6 +227,8 @@ } else { $meta['summary'] = sprintf(_("uploaded %s"), $sanified_userfile_name); } + $meta['mtime'] = time(); + $meta['author'] = $request->getUser()->getId(); $pagehandle->save($newtext, $version + 1, $meta); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2016-01-18 10:06:54
|
Revision: 9764 http://sourceforge.net/p/phpwiki/code/9764 Author: vargenau Date: 2016-01-18 10:06:52 +0000 (Mon, 18 Jan 2016) Log Message: ----------- UpLoad plugin: remove unused parameter in function log Modified Paths: -------------- trunk/lib/plugin/UpLoad.php Modified: trunk/lib/plugin/UpLoad.php =================================================================== --- trunk/lib/plugin/UpLoad.php 2016-01-16 16:28:16 UTC (rev 9763) +++ trunk/lib/plugin/UpLoad.php 2016-01-18 10:06:52 UTC (rev 9764) @@ -206,7 +206,7 @@ // the upload was a success and we need to mark this event in the "upload log" if ($logfile) { $upload_log = $file_dir . basename($logfile); - $this->log($userfile, $upload_log, $message); + $this->log($userfile, $upload_log); } if ($autolink) { require_once 'lib/loadsave.php'; @@ -241,7 +241,7 @@ return HTML($message, $form); } - private function log($userfile, $upload_log, &$message) + private function log($userfile, $upload_log) { global $WikiTheme; /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2016-02-10 14:57:09
|
Revision: 9786 http://sourceforge.net/p/phpwiki/code/9786 Author: vargenau Date: 2016-02-10 14:57:07 +0000 (Wed, 10 Feb 2016) Log Message: ----------- UpLoad plugin: don't inline images Modified Paths: -------------- trunk/lib/plugin/UpLoad.php Modified: trunk/lib/plugin/UpLoad.php =================================================================== --- trunk/lib/plugin/UpLoad.php 2016-02-08 19:32:53 UTC (rev 9785) +++ trunk/lib/plugin/UpLoad.php 2016-02-10 14:57:07 UTC (rev 9786) @@ -215,12 +215,16 @@ $current = $pagehandle->getCurrentRevision(); $version = $current->getVersion(); $text = $current->getPackedContent(); - // don't inline images if (UPLOAD_USERDIR) { - $newtext = $text . "\n* [[Upload:$username/$sanified_userfile_name]]"; + $image_link = "Upload:$username/$sanified_userfile_name"; } else { - $newtext = $text . "\n* [[Upload:$sanified_userfile_name]]"; + $image_link = "Upload:$sanified_userfile_name"; } + if (!is_image($sanified_userfile_name)) { + // Don't inline images + $image_link = "[[" . $image_link . "]]"; + } + $newtext = $text . "\n* " . $image_link; $meta = $current->_data; if (UPLOAD_USERDIR) { $meta['summary'] = sprintf(_("uploaded %s"), $username.'/'.$sanified_userfile_name); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2016-10-13 12:55:30
|
Revision: 9961 http://sourceforge.net/p/phpwiki/code/9961 Author: vargenau Date: 2016-10-13 12:55:27 +0000 (Thu, 13 Oct 2016) Log Message: ----------- UpLoad plugin: link was incorrect if image filename contained whitespace Modified Paths: -------------- trunk/lib/plugin/UpLoad.php Modified: trunk/lib/plugin/UpLoad.php =================================================================== --- trunk/lib/plugin/UpLoad.php 2016-10-11 08:17:04 UTC (rev 9960) +++ trunk/lib/plugin/UpLoad.php 2016-10-13 12:55:27 UTC (rev 9961) @@ -219,13 +219,16 @@ $version = $current->getVersion(); $text = $current->getPackedContent(); if (UPLOAD_USERDIR) { - $image_link = "Upload:$username/$sanified_userfile_name"; + $image_link = $username.'/'.$sanified_userfile_name; } else { - $image_link = "Upload:$sanified_userfile_name"; + $image_link = $sanified_userfile_name; } if (!is_image($sanified_userfile_name)) { // Don't inline images - $image_link = "[[" . $image_link . "]]"; + $image_link = '[[Upload:' . $image_link . ']]'; + } else { + // $image_link might contain a space + $image_link = 'Upload:' . rawurlencode($image_link); } $newtext = $text . "\n* " . $image_link; $meta = $current->_data; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2022-01-18 17:01:28
|
Revision: 10908 http://sourceforge.net/p/phpwiki/code/10908 Author: vargenau Date: 2022-01-18 17:01:26 +0000 (Tue, 18 Jan 2022) Log Message: ----------- In case there is an UPLOAD_USERDIR, the "/" must not be urlencoded Modified Paths: -------------- trunk/lib/plugin/UpLoad.php Modified: trunk/lib/plugin/UpLoad.php =================================================================== --- trunk/lib/plugin/UpLoad.php 2022-01-18 15:58:50 UTC (rev 10907) +++ trunk/lib/plugin/UpLoad.php 2022-01-18 17:01:26 UTC (rev 10908) @@ -223,6 +223,8 @@ } else { // $image_link might contain a space $image_link = 'Upload:' . rawurlencode($image_link); + // In case there is an UPLOAD_USERDIR, the "/" must not be urlencoded + $image_link = str_replace("%2F", "/", $image_link); } $newtext = $text . "\n* " . $image_link; $meta = $current->_data; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |