View Issue Details

IDProjectCategoryView StatusLast Update
0019609mantisbtadministrationpublic2016-08-15 09:02
Reporterbenoit.rollandAssigned Todregad 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.19 
Target Version1.2.20Fixed in Version1.2.20 
Summary0019609: function timezone_identifiers_list used before checked for existance. Lead to Fatal error
Description

function timezone_identifiers_list used before checked for existance. Lead to Fatal error

Fatal error: Call to undefined function timezone_identifiers_list() in /mnt/105/sdb/a/b/(...)/mantisbt-1.2.19/admin/check.php on line 388

Solution:
move line
$t_timezone_valid = in_array( $t_timezone, timezone_identifiers_list() );
from line 388 to after line 390
(inside next "if" block:)

/////////////////////////////// Current code //////////////////////////////
387:if( $t_timezone_set ) {
$t_timezone_valid = in_array( $t_timezone, timezone_identifiers_list() );
$t_msg = "Checking if the specified timezone is valid";
if( function_exists( 'timezone_identifiers_list' ) ) {

    if( !$t_timezone_valid ) {

/////////////////////////////// Should be: //////////////////////////////
387:if( $t_timezone_set ) {

$t_msg = "Checking if the specified timezone is valid";
if( function_exists( 'timezone_identifiers_list' ) ) {
    $t_timezone_valid = in_array( $t_timezone, timezone_identifiers_list() );
    if( !$t_timezone_valid ) {
Steps To Reproduce

Need a a server not supporting function: "timezone_identifiers_list"
(ex: pages perso, free.fr)
Call
http://.../mantisbt-1.2.19/admin/check.php

You will receive:

Fatal error: Call to undefined function timezone_identifiers_list() in /mnt/105/sdb/a/b/(...)/mantisbt-1.2.19/admin/check.php on line 388

TagsNo tags attached.

Activities

dregad

dregad

2015-04-13 05:16

developer   ~0049389

Amazing that free is still using PHP 5.1...

Anyway, thanks for the bug report.

Related Changesets

MantisBT: master-1.2.x ea6184a7

2015-04-13 05:13:45

dregad

Details Diff
Only use timezone_identifiers_list if it exists

The function was called during admin checks before its existence was
verified.

Fixes 0019609
mod - admin/check.php Diff File

Issue History

Date Modified Username Field Change
2015-04-12 08:49 benoit.rolland New Issue
2015-04-13 05:16 dregad Changeset attached => MantisBT master-1.2.x ea6184a7
2015-04-13 05:16 dregad Assigned To => dregad
2015-04-13 05:16 dregad Status new => resolved
2015-04-13 05:16 dregad Resolution open => fixed
2015-04-13 05:16 dregad Fixed in Version => 1.2.20
2015-04-13 05:16 dregad Target Version => 1.2.20
2015-04-13 05:16 dregad Note Added: 0049389
2016-08-15 09:02 dregad Status resolved => closed