Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions layouts/joomla/content/blog_style_default_item_title.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@
<span class="badge badge-warning"><?php echo Text::_('JNOTPUBLISHEDYET'); ?></span>
<?php endif; ?>

<?php if ($displayData->publish_down != Factory::getDbo()->getNullDate()
&& (strtotime($displayData->publish_down) < strtotime(Factory::getDate()))
) : ?>
<?php if ($displayData->publish_down !== null && strtotime($displayData->publish_down) < strtotime(Factory::getDate())) : ?>
Copy link
Member

Choose a reason for hiding this comment

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

Normalize code?
In other files it is
<?php if (!is_null($this->item->publish_down)
Don't know what is better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Strict null comparison is generally faster than is_null(). There's PHP-CS-Fixer rule for removing is_null() uses which we could apply eventually.

Copy link
Member

Choose a reason for hiding this comment

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

I didn't know that. Thanks for the info.

<span class="badge badge-warning"><?php echo Text::_('JEXPIRED'); ?></span>
<?php endif; ?>
</div>
Expand Down