WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#6047 closed defect (bug) (fixed)

Timezone Setting

Reported by: jeremyclark13 Owned by: 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)

comment:1 follow-up: @lloydbudd7 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 = '';

comment:2 in reply to: ↑ 1 @jeremyclark137 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.

comment:3 @ryan7 years ago

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

comment:4 @ryan7 years ago

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

comment:5 @lloydbudd7 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.

comment:6 @ryan7 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.