<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[17637] trunk: Remove PHP4 timezone support.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/17637">17637</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2011-04-13 17:30:02 +0000 (Wed, 13 Apr 2011)</dd>
</dl>
<h3>Log Message</h3>
<pre>Remove PHP4 timezone support. Props hakre. fixes <a href="http://trac.wordpress.org/ticket/16970">#16970</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminoptionsgeneralphp">trunk/wp-admin/options-general.php</a></li>
<li><a href="#trunkwpincludesdeprecatedphp">trunk/wp-includes/deprecated.php</a></li>
<li><a href="#trunkwpincludesfunctionsphp">trunk/wp-includes/functions.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminoptionsgeneralphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/options-general.php (17636 => 17637)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/options-general.php        2011-04-13 17:11:35 UTC (rev 17636)
+++ trunk/wp-admin/options-general.php        2011-04-13 17:30:02 UTC (rev 17637)
</span><span class="lines">@@ -135,45 +135,7 @@
</span><span class="cx"> <?php } ?>
</span><span class="cx"> <tr>
</span><span class="cx"> <?php
</span><del>-if ( !wp_timezone_supported() ) : // no magic timezone support here
-?>
-<th scope="row"><label for="gmt_offset"><?php _e('Timezone') ?> </label></th>
-<td>
-<select name="gmt_offset" id="gmt_offset">
-<?php
</del><span class="cx"> $current_offset = get_option('gmt_offset');
</span><del>-$offset_range = array (-12, -11.5, -11, -10.5, -10, -9.5, -9, -8.5, -8, -7.5, -7, -6.5, -6, -5.5, -5, -4.5, -4, -3.5, -3, -2.5, -2, -1.5, -1, -0.5,
-        0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 5.75, 6, 6.5, 7, 7.5, 8, 8.5, 8.75, 9, 9.5, 10, 10.5, 11, 11.5, 12, 12.75, 13, 13.75, 14);
-foreach ( $offset_range as $offset ) {
-        if ( 0 < $offset )
-                $offset_name = '+' . $offset;
-        elseif ( 0 == $offset )
-                $offset_name = '';
-        else
-                $offset_name = (string) $offset;
-
-        $offset_name = str_replace(array('.25','.5','.75'), array(':15',':30',':45'), $offset_name);
-
-        $selected = '';
-        if ( $current_offset == $offset ) {
-                $selected = " selected='selected'";
-                $current_offset_name = $offset_name;
-        }
-        echo "<option value=\"" . esc_attr($offset) . "\"$selected>" . sprintf(__('UTC %s'), $offset_name) . '</option>';
-}
-?>
-</select>
-<?php _e('hours'); ?>
-<span id="utc-time"><?php printf(__('<abbr title="Coordinated Universal Time">UTC</abbr> time is <code>%s</code>'), date_i18n( $time_format, false, 'gmt')); ?></span>
-<?php if ($current_offset) : ?>
-        <span id="local-time"><?php printf(__('UTC %1$s is <code>%2$s</code>'), $current_offset_name, date_i18n($time_format)); ?></span>
-<?php endif; ?>
-<br />
-<span class="description"><?php _e('Unfortunately, you have to manually update this for daylight saving time. The PHP Date/Time library is not supported by your web host.'); ?></span>
-</td>
-<?php
-else: // looks like we can do nice timezone selection!
-$current_offset = get_option('gmt_offset');
</del><span class="cx"> $tzstring = get_option('timezone_string');
</span><span class="cx">
</span><span class="cx"> $check_zone_info = true;
</span><span class="lines">@@ -250,7 +212,6 @@
</span><span class="cx"> <?php endif; ?>
</span><span class="cx"> </td>
</span><span class="cx">
</span><del>-<?php endif; ?>
</del><span class="cx"> </tr>
</span><span class="cx"> <tr>
</span><span class="cx"> <th scope="row"><?php _e('Date Format') ?></th>
</span></span></pre></div>
<a id="trunkwpincludesdeprecatedphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/deprecated.php (17636 => 17637)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/deprecated.php        2011-04-13 17:11:35 UTC (rev 17636)
+++ trunk/wp-includes/deprecated.php        2011-04-13 17:30:02 UTC (rev 17637)
</span><span class="lines">@@ -2618,4 +2618,18 @@
</span><span class="cx">         _deprecated_function( __FUNCTION__, '3.2' );
</span><span class="cx">
</span><span class="cx">         return clone $object;
</span><del>-}
</del><span class="cx">\ No newline at end of file
</span><ins>+}
+
+/**
+ * Check for PHP timezone support
+ *
+ * @since 2.9.0
+ * @deprecated 3.2
+ *
+ * @return bool
+ */
+function wp_timezone_supported() {
+        _deprecated_function( __FUNCTION__, '3.2' );
+
+        return true;
+}
</ins></span></pre></div>
<a id="trunkwpincludesfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/functions.php (17636 => 17637)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/functions.php        2011-04-13 17:11:35 UTC (rev 17636)
+++ trunk/wp-includes/functions.php        2011-04-13 17:30:02 UTC (rev 17637)
</span><span class="lines">@@ -120,7 +120,7 @@
</span><span class="cx">         }
</span><span class="cx">         $timezone_formats = array( 'P', 'I', 'O', 'T', 'Z', 'e' );
</span><span class="cx">         $timezone_formats_re = implode( '|', $timezone_formats );
</span><del>-        if ( preg_match( "/$timezone_formats_re/", $dateformatstring ) && wp_timezone_supported() ) {
</del><ins>+        if ( preg_match( "/$timezone_formats_re/", $dateformatstring ) ) {
</ins><span class="cx">                 $timezone_string = get_option( 'timezone_string' );
</span><span class="cx">                 if ( $timezone_string ) {
</span><span class="cx">                         $timezone_object = timezone_open( $timezone_string );
</span><span class="lines">@@ -4062,9 +4062,6 @@
</span><span class="cx"> * @return float|bool
</span><span class="cx"> */
</span><span class="cx"> function wp_timezone_override_offset() {
</span><del>-        if ( !wp_timezone_supported() ) {
-                return false;
-        }
</del><span class="cx">         if ( !$timezone_string = get_option( 'timezone_string' ) ) {
</span><span class="cx">                 return false;
</span><span class="cx">         }
</span><span class="lines">@@ -4078,27 +4075,6 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Check for PHP timezone support
- *
- * @since 2.9.0
- *
- * @return bool
- */
-function wp_timezone_supported() {
-        $support = false;
-        if (
-                function_exists( 'date_create' ) &&
-                function_exists( 'date_default_timezone_set' ) &&
-                function_exists( 'timezone_identifiers_list' ) &&
-                function_exists( 'timezone_open' ) &&
-                function_exists( 'timezone_offset_get' )
-        ) {
-                $support = true;
-        }
-        return apply_filters( 'timezone_support', $support );
-}
-
-/**
</del><span class="cx"> * {@internal Missing Short Description}}
</span><span class="cx"> *
</span><span class="cx"> * @since 2.9.0
</span></span></pre>
</div>
</div>
</body>
</html>