Skip to content

Commit

Permalink
Fix: Avoid explode when separator : is not.
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Sep 18, 2014
1 parent 65a69d3 commit 49db9d1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion htdocs/core/lib/functions.lib.php
Expand Up @@ -1841,7 +1841,8 @@ function img_picto($titlealt, $picto, $options = '', $pictoisfullpath = false, $
if ($srconly) return $fullpathpicto;
else
{
$tmparray=explode(':',$titlealt);
$tmparray=array(0=>$titlealt);
if (preg_match('/:[^\s]/',$titlealt)) $tmparray=explode(':',$titlealt); // We explode if we have TextA:TextB. Not if we have TextA: TextB
$title=$tmparray[0];
$alt=empty($tmparray[1])?'':$tmparray[1];
return '<img src="'.$fullpathpicto.'" border="0" alt="'.dol_escape_htmltag($alt).'"'.($notitle?'':' title="'.dol_escape_htmltag($title).'"').($options?' '.$options:'').'>'; // Alt is used for accessibility, title for popup
Expand Down

0 comments on commit 49db9d1

Please sign in to comment.