Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[com_content] Fix layout in category link #20200

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 2 additions & 4 deletions components/com_content/helpers/route.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,8 @@ public static function getCategoryRoute($catid, $language = 0)
$link .= '&lang=' . $language;
}

$jinput = JFactory::getApplication()->input;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO 'cmd' should be better than 'string'

Copy link
Contributor Author

@Septdir Septdir Apr 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if CMD layout was templatelayout and bug still alive if string template:layout this bug was on my site =)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the layout can contain colon, then yes, I'm wrong.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@csthomas You were not wrong, just a filter designed for parameters why ignores the colon

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pattern for CMD is $pattern = '/[^A-Z0-9_\.-]/i';.

There could be a two options: add colon to filter code or replace colon to dot in layout.
The same as work for task=controller.method.

At now you do not have an option, stay with string.

$layout = $jinput->get('layout');

if ($layout !== '')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just a cosmetic suggestion. Instead of if (!empty($layout)) would be better to use if ($layout). We do not need to check if $layout is set.

Copy link
Contributor Author

@Septdir Septdir Apr 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, I somehow did not even think. Done

$layout = JFactory::getApplication()->input->get('layout', '', 'string');
if (!empty($layout))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add blank line above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

{
$link .= '&layout=' . $layout;
}
Expand Down