Skip to content

Conversation

janschoenherr
Copy link
Contributor

Summary of Changes

Just a bit of code cleanup.

Testing Instructions

Use custom offline message on the offline page.

Actual result BEFORE applying this Pull Request

no change

Expected result AFTER applying this Pull Request

no change

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

Copy link
Member

@richard67 richard67 left a comment

Choose a reason for hiding this comment

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

By review this change is good.

@janschoenherr
Copy link
Contributor Author

@richard67 Thanks, found a couple of more places.

@laoneo
Copy link
Member

laoneo commented Sep 25, 2025

What is the benefit here? Not saying the change is wrong, but is there a performance gain or so?

@richard67
Copy link
Member

What is the benefit here? Not saying the change is wrong, but is there a performance gain or so?

@laoneo There is a performance gain as str_replace checks the whole string for spaces, while trim only checks beginning and end, which functionally is sufficient here.

@laoneo
Copy link
Member

laoneo commented Sep 25, 2025

But trim checks multiple characters. Anyway, don't want to block this. But not sure if the override notification is worth the change.

@richard67
Copy link
Member

No need to hurry anyway. It might go into 5.4.1 and 6.0.1 because we are short before preparing RC 1, and between RC 1 and stable we only want to fix regressions, if some.

<?php endif; ?>

<?php if (($this->params->get('logoutdescription_show') == 1 && str_replace(' ', '', $this->params->get('logout_description', '')) != '') || $this->params->get('logout_image') != '') : ?>
<?php if (($this->params->get('logoutdescription_show') == 1 && trim($this->params->get('logout_description', '')) != '') || $this->params->get('logout_image') != '') : ?>
Copy link
Contributor

Choose a reason for hiding this comment

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

The if conditions at line 28 and line 40 are the same, so we should introduce a variable like $showLogout to store the result of the expression at line 28 and re-use it for line 40 (instead of re-evaluate the same condition again)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants