Ticket #10332: functions.php.2.diff

File functions.php.2.diff, 943 bytes (added by gosunatxrea, 4 years ago)

use version_compare

Line 
1--- wp-includes/functions.php.orig      Mon Aug 03 01:18:21 2009
2+++ wp-includes/functions.php   Mon Aug 03 01:14:51 2009
3@@ -86,15 +86,18 @@
4 function date_i18n( $dateformatstring, $unixtimestamp = false, $gmt = false ) {
5        global $wp_locale;
6        $i = $unixtimestamp;
7-       // Sanity check for PHP 5.1.0-
8-       if ( false === $i || intval($i) < 0 ) {
9-               if ( ! $gmt )
10-                       $i = current_time( 'timestamp' );
11-               else
12-                       $i = time();
13-               // we should not let date() interfere with our
14-               // specially computed timestamp
15-               $gmt = true;
16+
17+       if (version_compare( '5.1.0', phpversion(), '>=' )) {
18+               // Sanity check for PHP 5.1.0-
19+               if ( false === $i || intval($i) < 0 ) {
20+                       if ( ! $gmt )
21+                               $i = current_time( 'timestamp' );
22+                       else
23+                               $i = time();
24+                       // we should not let date() interfere with our
25+                       // specially computed timestamp
26+                       $gmt = true;
27+               }
28        }
29 
30        // store original value for language with untypical grammars