Replace strlen() calls with strict string comparisons
authorThiemo Kreuz <thiemo.kreuz@wikimedia.de>
Wed, 27 Mar 2019 10:13:08 +0000 (11:13 +0100)
committerThiemo Kreuz <thiemo.kreuz@wikimedia.de>
Thu, 28 Mar 2019 11:32:39 +0000 (12:32 +0100)
commit5833dda61d64afdcacf5e6d73aaae2800cc8e496
tree603d4e259461d44c012abc7ba0491bb2919d124b
parent8a0f5676c92c486656b260c448c8e0284e5321ca
Replace strlen() calls with strict string comparisons

Note there is an important difference between the two ways to express
this: strlen() does a string cast, but the `=== ''` and `!== ''`
comparisons will only detect empty strings, but not null, false, or any
other falsy value that becomes an empty string when cast to be one.

I am only touching code where I'm sure the variable is guaranteed to be
a string.

This change is done because I find the strict comparisons much more
readable. The code does exactly one thing now, and no magic casts any
more.

Change-Id: I3e908a0c7c7b6c29b0e5a1414f2ba9062a215b93
includes/MovePage.php
includes/SiteConfiguration.php
includes/api/ApiQuerySiteinfo.php
includes/content/WikiTextStructure.php
includes/http/PhpHttpRequest.php
includes/jobqueue/jobs/ThumbnailRenderJob.php
includes/libs/rdbms/database/DatabaseDomain.php
includes/specials/SpecialSearch.php