Fork me on GitHub
Subscribe 6

Ticket #642 (fixed bug)

Test NULL must be "===" or is_null(...)

  • Created: 2012-03-21 17:21:16
  • Reported by: Otomatic
  • Assigned to: Oldskool
  • Milestone: 1.4.9
  • Component: code
  • Priority: normal

parser.php
Line 85

	if ($temp === null)

Line 678

	if ($alt == null)

Two lines must be with "===" or is_null() fonction.

History

Wan 2012-03-21 21:52:45

Comment edited 1 times (Diff)

Franz 2012-03-21 22:17:37

What about the first one? I see '===', not '=='. Or did you just mistype?

Otomatic 2012-03-22 09:02:17

It was just to show that some comparisons were correct.
I think Wan showed all incorrect lines in the link noted above

Franz 2012-03-22 09:31:01

  • Milestone set to 1.4.9.

Ah, thanks.

Oldskool 2012-03-22 10:45:31

Personally, I think using is_null is the cleanest method to use to check for null values. Avoids such mistakes/inconsistencies. Will take a look at it.

Comment edited 1 times (Diff)

Oldskool 2012-03-22 10:46:14

  • Owner set to Oldskool.

  2012-03-22 11:09:50

Commit bb92cd1 to fluxbb fluxbb-1.4

#642 - Setting all null-checks to use is_null()

Oldskool 2012-03-22 11:22:03

  • Status changed from open to fixed.

All done, just commited the patched file to the fluxbb-1.4 branch on github.

Franz 2012-03-22 20:10:49

Looks like there were some more in Wan's post.

Oldskool 2012-03-23 08:59:52

  • Status changed from fixed to open.

You are right, going to take a look at it!

arw 2012-03-24 23:19:47

there is too :

./include/functions.php:569:	if ($p != null)

Oldskool 2012-03-25 20:24:09

Commit 6ab8b6a to fluxbb fluxbb-1.4

#642 - Replaced all "custom" null-checks with is_null() checks.

Oldskool 2012-03-25 20:39:34

Commit 135fc3c to fluxbb fluxbb-1.4

Merge pull request #27 from oldskool/fluxbb-1.4

#642 - Replaced all "custom" null-checks with is_null() checks.

Oldskool 2012-03-25 20:41:32

  • Status changed from open to fixed.

All done now, did a search for null checks throughout the entire project and replace all that I could find smile If I missed any, please let me know!

Visman 2012-03-25 23:55:12

mysqli_innodb.php ?

Oldskool 2012-03-26 07:41:53

Commit 7537e46 to fluxbb fluxbb-1.4

Forgotten file of #642

Oldskool 2012-03-26 07:45:17

I could've sworn I also updated that file. Re-committed, well spotted Visman! Thanks for reporting it.