FIX image extension must be in lower case
Conflicts: htdocs/core/lib/files.lib.php
This commit is contained in:
parent
c0b2d7405a
commit
066c793de2
@ -859,11 +859,15 @@ class FormFile
|
||||
{
|
||||
$fileinfo = pathinfo($file['name']);
|
||||
print '<td align="center">';
|
||||
$minifile=$fileinfo['filename'].'_mini.'.strtolower($fileinfo['extension']); // Thumbs are created with filename in lower case
|
||||
if (image_format_supported($file['name']) > 0)
|
||||
{
|
||||
print '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&file='.urlencode($relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension'])).'" class="aphoto" target="_blank">';
|
||||
print '<img border="0" height="'.$maxheightmini.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&file='.urlencode($relativepath.'thumbs/'.$minifile).'" title="">';
|
||||
$minifile=getImageFileNameForSize($file['name'], '_mini', '.png'); // Thumbs are created with filename in lower case and with .png extension
|
||||
//print $relativepath.'<br>';
|
||||
//print $file['path'].'/'.$minifile.'<br>';
|
||||
if (! dol_is_file($file['path'].'/'.$minifile)) $minifile=getImageFileNameForSize($file['name'], '_mini', '.'.$fileinfo['extension']); // For old thumbs
|
||||
//print $file['path'].'/'.$minifile.'<br>';
|
||||
print '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&file='.urlencode($relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension'])).'" class="aphoto" target="_blank">';
|
||||
print '<img border="0" height="'.$maxheightmini.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&file='.urlencode($relativepath.$minifile).'" title="">';
|
||||
print '</a>';
|
||||
}
|
||||
else print ' ';
|
||||
|
||||
@ -1451,6 +1451,12 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio
|
||||
$destfile=preg_replace('/__file__/',$_FILES[$varfiles]['name'],$savingdocmask);
|
||||
}
|
||||
|
||||
// lowercase extension
|
||||
$info = pathinfo($destpath);
|
||||
$destpath = $info['dirname'].'/'.$info['filename'].'.'.strtolower($info['extension']);
|
||||
$info = pathinfo($destfile);
|
||||
$destfile = $info['filename'].'.'.strtolower($info['extension']);
|
||||
|
||||
$resupload = dol_move_uploaded_file($_FILES[$varfiles]['tmp_name'], $destpath, $allowoverwrite, 0, $_FILES[$varfiles]['error'], 0, $varfiles);
|
||||
if (is_numeric($resupload) && $resupload > 0)
|
||||
{
|
||||
|
||||
@ -473,6 +473,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName='_small', $
|
||||
}
|
||||
|
||||
// Initialisation des variables selon l'extension de l'image
|
||||
// $targetformat is 0 by default, in such case, we keep original extension
|
||||
switch($targetformat)
|
||||
{
|
||||
case IMAGETYPE_GIF: // 1
|
||||
|
||||
Loading…
Reference in New Issue
Block a user