Changeset 35284 for trunk/src/wp-includes/formatting.php
- Timestamp:
- 10/20/2015 06:07:45 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r35252 r35284 612 612 . '(?:]]>)?'; // End of comment. If not found, match all input. 613 613 614 $escaped = 614 $escaped = 615 615 '(?=' // Is the element escaped? 616 616 . '!--' … … 2588 2588 if ( $tz ) { 2589 2589 $datetime = date_create( $string, new DateTimeZone( $tz ) ); 2590 if ( ! $datetime ) 2590 if ( ! $datetime ) { 2591 2591 return gmdate( $format, 0 ); 2592 } 2592 2593 $datetime->setTimezone( new DateTimeZone( 'UTC' ) ); 2593 2594 $string_gmt = $datetime->format( $format ); 2594 2595 } else { 2595 if ( ! preg_match( '#([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})#', $string, $matches ) ) 2596 return gmdate( $format, 0 ); 2596 if ( ! preg_match( '#([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})#', $string, $matches ) ) { 2597 $datetime = strtotime( $string ); 2598 if ( false === $datetime ) { 2599 return gmdate( $format, 0 ); 2600 } 2601 return gmdate( $format, $datetime ); 2602 } 2597 2603 $string_time = gmmktime( $matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1] ); 2598 2604 $string_gmt = gmdate( $format, $string_time - get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ); … … 3877 3883 * This is similar to `array_walk_recursive()` but acts upon objects too. 3878 3884 * 3879 * @since 4.4.0 3880 * 3885 * @since 4.4.0 3886 * 3881 3887 * @param mixed $value The array, object, or scalar. 3882 * @param callable $ functionThe function to map onto $value.3888 * @param callable $callback The function to map onto $value. 3883 3889 * @return The value with the callback applied to all non-arrays and non-objects inside it. 3884 3890 */
Note: See TracChangeset
for help on using the changeset viewer.