Jump to content

Lol, there you made a mistake :P


Fusl

Recommended Posts

http://www.whmcs.com/images/addons/licensingaddon.png

 

In this code you write

[...]
if ($status!='expired') {
   die("License Expired");
[...]

 

This means exactly: If status_of_license is not expired, exit with error "License expired" and therefor this isn't exactly correct. Instead you should use =='expired' or even better: ==='expired'

/http://kvz.io/blog/2013/04/23/change-your-codebase-to-use-triple-equality/

 

Just sayin... And don't think "Shut up and take my money" now :D

Link to comment
Share on other sites

=== would be better in a case where you need to check they type is correct, thats its purpose, although in this instance it makes little sense because the type is a string and to match the type must be a string anyway.

 

Typecasting makes sense when you are dealing with values that without type casting would evaluate as the same result

 

EG:

true == 1 (true)

true === 1 (false)

false == 0 (true)

false === 0 (false)

 

I am not going to go into the coding itself.

Edited by CDJ Hosting
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated