Make WordPress Core

Opened 17 years ago

Closed 17 years ago

#6047 closed defect (bug) (fixed)

Timezone Setting

Reported by: jeremyclark13's profile jeremyclark13 Owned by: ryan's profile ryan
Milestone: 2.5 Priority: normal
Severity: major Version: 2.5
Component: Administration Keywords: timezone, php error
Focuses: 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 (6)

#1 follow-up: @lloydbudd
17 years ago

  • Milestone 2.5 deleted
  • Resolution set to worksforme
  • Status changed from new to closed

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 = '';

#2 in reply to: ↑ 1 @jeremyclark13
17 years ago

  • Milestone set to 2.5
  • Resolution worksforme deleted
  • Status changed from closed to reopened
  • Version 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.

#3 @ryan
17 years ago

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

#4 @ryan
17 years ago

  • Owner changed from anonymous to ryan
  • Status changed from reopened to new

#5 @lloydbudd
17 years ago

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.

#6 @ryan
17 years ago

  • Resolution set to fixed
  • Status changed from new to closed

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

Note: See TracTickets for help on using tickets.