1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-05 06:07:32 +02:00

Fix for empty image.

This commit is contained in:
Cameron
2021-06-13 12:59:01 -07:00
parent f2966468ea
commit 4e75903292
2 changed files with 9 additions and 12 deletions

View File

@@ -150,6 +150,8 @@
return null; return null;
} }
$ret = null;
switch($fieldType) switch($fieldType)
{ {
case 'dropdown': case 'dropdown':
@@ -160,11 +162,7 @@
case 'video': case 'video':
if(empty($value)) if(!empty($value))
{
$ret = null;
}
else
{ {
$ret = ($raw) ? 'https://www.youtube.com/watch?v='.str_replace('.youtube', '', $value) : $tp->toVideo($value); $ret = ($raw) ? 'https://www.youtube.com/watch?v='.str_replace('.youtube', '', $value) : $tp->toVideo($value);
} }
@@ -173,7 +171,10 @@
case 'image': case 'image':
if(!empty($value))
{
$ret = ($raw) ? $tp->thumbUrl($value,$parm) : $tp->toImage($value,$parm); $ret = ($raw) ? $tp->thumbUrl($value,$parm) : $tp->toImage($value,$parm);
}
break; break;
case 'icon': case 'icon':
@@ -198,11 +199,7 @@
break; break;
case 'file': case 'file':
if(empty($value)) if(!empty($value))
{
$ret = null;
}
else
{ {
$ret = ($raw) ? $tp->toFile($value, array('raw'=>1)) : $tp->toFile($value); $ret = ($raw) ? $tp->toFile($value, array('raw'=>1)) : $tp->toFile($value);
} }

View File

@@ -258,7 +258,7 @@
$expectedRawValues = array ( $expectedRawValues = array (
'image' => 'thumb.php?src=', 'image' => 'thumb.php?src=',
'video' => 'https://www.youtube.com/watch?v=WcuRPzB4RNc', 'video' => 'https://www.youtube.com/watch?v=WcuRPzB4RNc',
'bbarea' => '<!-- bbcode-html-start --><p><b>Rich text.</b></p><!-- bbcode-html-end -->', 'bbarea' => '[html]<p><b>Rich text.</b></p>[/html]',
'boolean' => '1', 'boolean' => '1',
'checkboxes' => 'boat,plane', 'checkboxes' => 'boat,plane',
'country' => 'ad', 'country' => 'ad',