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