Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.7/wp-includes/functions.php

    r10150 r10491  
    8080 * The 'timestamp' type will return the current timestamp.
    8181 *
    82  * If the $gmt is set to either '1' or 'true', then both types will use the
    83  * GMT offset in the WordPress option to add the GMT offset to the time.
     82 * If $gmt is set to either '1' or 'true', then both types will use GMT time.
     83 * if $gmt is false, the output is adjusted with the GMT offset in the WordPress option.
    8484 *
    8585 * @since 1.0.0
    8686 *
    8787 * @param string $type Either 'mysql' or 'timestamp'.
    88  * @param int|bool $gmt Optional. Whether to use $gmt offset. Default is false.
     88 * @param int|bool $gmt Optional. Whether to use GMT timezone. Default is false.
    8989 * @return int|string String if $type is 'gmt', int if $type is 'timestamp'.
    9090 */
     
    28052805 */
    28062806function is_ssl() {
    2807     return ( isset($_SERVER['HTTPS']) && 'on' == strtolower($_SERVER['HTTPS']) ) ? true : false;
     2807    if ( isset($_SERVER['HTTPS']) ) {
     2808        if ( 'on' == strtolower($_SERVER['HTTPS']) )
     2809            return true;
     2810        if ( '1' == $_SERVER['HTTPS'] )
     2811            return true;
     2812    } elseif ( isset($_SERVER['SERVER_PORT']) && ( '443' == $_SERVER['SERVER_PORT'] ) ) {
     2813        return true;
     2814    }
     2815    return false;
    28082816}
    28092817
     
    28982906 * @return object The cloned object
    28992907 */
    2900 function wp_clone($object) {
    2901     return version_compare(phpversion(), '5.0') < 0 ? $object : clone($object);
     2908function wp_clone( $object ) {
     2909    static $can_clone;
     2910    if ( !isset( $can_clone ) ) {
     2911        $can_clone = version_compare( phpversion(), '5.0', '>=' );
     2912    }
     2913    return $can_clone ? clone( $object ) : $object;
    29022914}
    29032915
Note: See TracChangeset for help on using the changeset viewer.