RefreshLinksJob: Replace use of empty() with explicit check
authorTimo Tijhof <krinklemail@gmail.com>
Wed, 18 Sep 2013 04:34:32 +0000 (06:34 +0200)
committerTimo Tijhof <krinklemail@gmail.com>
Wed, 18 Sep 2013 04:34:32 +0000 (06:34 +0200)
Using empty() is a maintenance nightmare as it completely removes
any meaning of what the author intends to check for (whether the
variable exists at all, it being set to an empty array, 0, '0' etc.)

Follows-up I445e10da122e5f24e589 which changed it from isset()
to !empty() with commit message of checking for false.

Change-Id: I561f03b0526685f51138d723f9eb7196725e0b93

includes/job/jobs/RefreshLinksJob.php

index 474212b..4fc8bac 100644 (file)
@@ -48,7 +48,7 @@ class RefreshLinksJob extends Job {
                # Wait for the DB of the current/next slave DB handle to catch up to the master.
                # This way, we get the correct page_latest for templates or files that just changed
                # milliseconds ago, having triggered this job to begin with.
-               if ( !empty( $this->params['masterPos'] ) ) {
+               if ( isset( $this->params['masterPos'] ) && $this->params['masterPos'] !== false ) {
                        wfGetLB()->waitFor( $this->params['masterPos'] );
                }