?
avatar ReLater
ReLater
23 Feb 2018

Steps to reproduce the issue

-1: Returns a <img> tag without looking for relative files

  • Add PHP code in your template's index.php and see the output in HTML source code of loaded page.
$img = 'images/thing.jpg';
$name = 'Thing is Thang';
$attribs = '';
$img = JHtml::_('image', $img, $name, $attribs, false, -1);
echo $img;
exit;

Expected result

Method should return

<img src="images/thing.jpg" alt="Thing is Thang" />

because the last parameter ($returnPath) is -1 in code above

Actual result

Method returns only a path

images/thing.jpg

which should be only the case if $returnPath = 1 (and file exists in a calculated relative path; otherwise empty path).

avatar ReLater ReLater - open - 23 Feb 2018
avatar joomla-cms-bot joomla-cms-bot - change - 23 Feb 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 23 Feb 2018
avatar ReLater ReLater - change - 23 Feb 2018
The description was changed
avatar ReLater ReLater - edited - 23 Feb 2018
avatar ReLater ReLater - change - 23 Feb 2018
The description was changed
avatar ReLater ReLater - edited - 23 Feb 2018
avatar ReLater ReLater - change - 23 Feb 2018
The description was changed
avatar ReLater ReLater - edited - 23 Feb 2018
avatar franz-wohlkoenig franz-wohlkoenig - change - 23 Feb 2018
Category Code style com_tags
avatar Quy
Quy - comment - 23 Feb 2018

Confirmed. Can you please do a PR? Thanks.

avatar franz-wohlkoenig franz-wohlkoenig - change - 23 Feb 2018
Status New Discussion
avatar ReLater ReLater - change - 24 Feb 2018
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2018-02-24 01:36:11
Closed_By ReLater
avatar ReLater
ReLater - comment - 24 Feb 2018

See PR #19770

avatar ReLater ReLater - close - 24 Feb 2018

Add a Comment

Login with GitHub to post a comment