Making WordPress.org

Changeset 5537


Ignore:
Timestamp:
06/05/2017 10:51:59 PM (9 years ago)
Author:
iandunn
Message:

Events: Return false instead of null

See #2823
Props dd32

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/events/1.0/index.php

    r5501 r5537  
    142142                 *
    143143                 * @todo Update the user-agent strings if 40702-geoip.2.diff doesn't make it into beta2
    144                  * @todo Remove this back-compat code after beta2 has been out for a few days
     144                 * @todo Remove this back-compat code after 4.8.0 has been out for a few days, to avoid
     145                 *       impacting the feature plugin in 4.7 installs. rebuild_location_from_event_source()
     146                 *       can probably be removed at that time too.
    145147                 */
    146148                $use_fuzzy_locations = false !== strpos( $_SERVER['HTTP_USER_AGENT'], '4.7' ) || false !== strpos( $_SERVER['HTTP_USER_AGENT'], '4.8-beta1' );
     
    387389 * @param string $dotted_ip
    388390 *
    389  * @return null|object `null` on failure; an object on success
     391 * @return false|object `false` on failure; an object on success
    390392 */
    391393function guess_location_from_ip( $dotted_ip ) {
     
    405407
    406408        if ( false === $long_ip || ! isset( $from, $where ) ) {
    407                 return;
     409                return false;
    408410        }
    409411
     
    419421        // Unknown location:
    420422        if ( ! $row || '-' == $row->country_short ) {
    421                 return;
     423                return false;
    422424        }
    423425
Note: See TracChangeset for help on using the changeset viewer.