Ticket #6047 (closed defect: fixed)

Opened 9 months ago

Last modified 9 months ago

Timezone Setting

Reported by: jeremyclark13 Assigned to: ryan
Priority: normal Milestone: 2.5
Component: Administration Version: 2.5
Severity: major Keywords: timezone, php error
Cc:

Description

The timezone setting is now blank in the General Options menu. Using Rev 7103, PHP v. 4.4.7

Errors in log

Invalid argument supplied for foreach() in /var/www/html/beta/wp-admin/options-general.php on line 62, referer: ...

Change History

(follow-up: ↓ 2 ) 02/29/08 16:48:25 changed by lloydbudd

  • status changed from new to closed.
  • resolution set to worksforme.
  • milestone deleted.

Works for me.

My guess is that there is conflict when you svn up.

This is the code around those lines here:

<?php 
$current_offset = get_option('gmt_offset');
foreach ( range(-12, 12, 0.5) as $offset ) {
	if ( 0 < $offset )
		$offset_name = '+' . $offset;
	elseif ( 0 == $offset )
		$offset_name = '';

(in reply to: ↑ 1 ) 02/29/08 17:09:59 changed by jeremyclark13

  • status changed from closed to reopened.
  • version set to 2.5.
  • resolution deleted.
  • milestone set to 2.5.

Replying to lloydbudd:

Works for me. My guess is that there is conflict when you svn up. This is the code around those lines here: {{{ <?php $current_offset = get_option('gmt_offset'); foreach ( range(-12, 12, 0.5) as $offset ) { if ( 0 < $offset ) $offset_name = '+' . $offset; elseif ( 0 == $offset ) $offset_name = ; }}}

Nope no conflicts and that is the code in my options-general file. My guess is an incompatiblity with the php version.

02/29/08 17:19:26 changed by ryan

Ah, the step argument was added in PHP 5. Bummer.

02/29/08 17:22:28 changed by ryan

  • owner changed from anonymous to ryan.
  • status changed from reopened to new.

02/29/08 18:58:52 changed by lloydbudd

jeremyclark13, nice catch!

My guess if it wasn't a conflict then it was a PHP version issue, but I didn't see anything obvious looking at http://php.net/foreach . Still don't, but Ryan knows, and prolly poorly written doc.

02/29/08 19:00:53 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

(In [7108]) Hardcode offset range since the step argument to range is PHP 5 only. fixes #6047