View Issue Details

IDProjectCategoryView StatusLast Update
0019609mantisbtadministrationpublic2016-08-15 09:02
Reporterbenoit.rolland Assigned 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 01:13

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
Affected Issues
0019609
mod - admin/check.php Diff File