Fix regression
This commit is contained in:
parent
109d9cab85
commit
53d2f29cdd
@ -2739,7 +2739,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
|||||||
//if (empty($notitle) && preg_match('/:[^\s0-9]/',$titlealt)) $tmparray=explode(':',$titlealt); // We explode if we have TextA:TextB. Not if we have TextA: TextB
|
//if (empty($notitle) && preg_match('/:[^\s0-9]/',$titlealt)) $tmparray=explode(':',$titlealt); // We explode if we have TextA:TextB. Not if we have TextA: TextB
|
||||||
//$title=$tmparray[0];
|
//$title=$tmparray[0];
|
||||||
//$alt=empty($tmparray[1])?'':$tmparray[1];
|
//$alt=empty($tmparray[1])?'':$tmparray[1];
|
||||||
$title=$titletag;
|
$title=$titlealt;
|
||||||
return '<img src="'.$fullpathpicto.'" alt="'.dol_escape_htmltag($alt).'"'.(($notitle || empty($title))?'':' title="'.dol_escape_htmltag($title).'"').($moreatt?' '.$moreatt:' class="inline-block"').'>'; // Alt is used for accessibility, title for popup
|
return '<img src="'.$fullpathpicto.'" alt="'.dol_escape_htmltag($alt).'"'.(($notitle || empty($title))?'':' title="'.dol_escape_htmltag($title).'"').($moreatt?' '.$moreatt:' class="inline-block"').'>'; // Alt is used for accessibility, title for popup
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -817,10 +817,6 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase
|
|||||||
$s=img_picto('title','/fullpath/img.png','',true);
|
$s=img_picto('title','/fullpath/img.png','',true);
|
||||||
print __METHOD__." s=".$s."\n";
|
print __METHOD__." s=".$s."\n";
|
||||||
$this->assertEquals('<img src="/fullpath/img.png" alt="" title="title" class="inline-block">',$s,'testImgPicto4');
|
$this->assertEquals('<img src="/fullpath/img.png" alt="" title="title" class="inline-block">',$s,'testImgPicto4');
|
||||||
|
|
||||||
$s=img_picto('title:alt','/fullpath/img.png','',true);
|
|
||||||
print __METHOD__." s=".$s."\n";
|
|
||||||
$this->assertEquals('<img src="/fullpath/img.png" alt="alt" title="title" class="inline-block">',$s,'testImgPicto5');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user