mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 21:57:51 +02:00
Fix for empty image.
This commit is contained in:
@@ -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':
|
||||||
$ret = ($raw) ? $tp->thumbUrl($value,$parm) : $tp->toImage($value,$parm);
|
if(!empty($value))
|
||||||
|
{
|
||||||
|
$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);
|
||||||
}
|
}
|
||||||
|
@@ -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',
|
||||||
|
Reference in New Issue
Block a user