Problem/Motivation

There's some slightly messy code in _link_sanitize() where PHP's comparison logic is slightly ambiguous.

Proposed resolution

Streamline the variable assertions so that it never does if($variable)

Remaining tasks

Provide a patch.

User interface changes

n/a

API changes

n/a

Data model changes

n/a

CommentFileSizeAuthor
#2 link-n3254549-2.patch1.34 KBdamienmckenna

Comments

DamienMcKenna created an issue. See original summary.

damienmckenna’s picture

Status: Active » Needs review
StatusFileSize
new1.34 KB

This is what I'm thinking.

renatog’s picture

Status: Needs review » Reviewed & tested by the community

In the beginning I was thinking if instead of
if ($title !== '') {
We should use
if (!empty($title)) {

But now I can see that it's really makes sense.

In some cases if the string is 0, or '0' will return as "empty" as well, so the patch makes sense for me. Thanks a lot @DamienMcKenna :D

  • RenatoG committed 6c5d19c on 7.x-1.x authored by DamienMcKenna
    Issue #3254549 by DamienMcKenna, RenatoG: Tidy variable assertion logic...
renatog’s picture

Status: Reviewed & tested by the community » Fixed

Moved to the dev branch o/

Thank you so much for always doing a great job in your contributions, Damien

damienmckenna’s picture

👍

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.