Timezone error in file manager

I think this may be a bug, but I'm not really sure. No matter what I set the timezone to in the general options, I get the following error:

It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /<my_server>/public_html/media2.cokertire.com/zp-core/zp-extensions/tiny_mce/plugins/ajaxfilemanager/inc/class.session.php on line 85

I have changed it to different timezones, but this error persists...

Comments

  • acrylian Administrator, Developer
    The file manager is an adapted 3rd tool which use rather plain (www.phpletter.com) and those we generally try not to modify to avoid issues with upgrades. I have never got this error btw. Maybe my collegue has any idea about that later.
  • Yes, I can not find anyone experiencing the same issue...it's very odd, and this is a fresh install.
  • The line is ajaxfilemanager is merely getting the current date in 24 hour format via the PHP date() function. So presumably the error is caused because there never was a setting of the default timezone somewhere.

    Zenphoto does the following in functons-basic.php right at startup to be sure the timezone is set.
    `
    if (function_exists('date_default_timezone_set')) {
    $level = error_reporting(0);
    $_zp_server_timezone = date_default_timezone_get();
    date_default_timezone_set($_zp_server_timezone);
    @ini_set('date.timezone', $_zp_server_timezone);
    error_reporting($level);
    }
    `
    So somewhere in the startup of the ajaxfilemanager this needs be done.
  • Thank you, got it fixed:

    Add this code just under "<?php" in the file "ajaxfilemanager.php"

    /* Timezone Fix Start */
    if (function_exists('date_default_timezone_set')) {
    $level = error_reporting(0);
    $_zp_server_timezone = date_default_timezone_get();
    date_default_timezone_set($_zp_server_timezone);
    @ini_set('date.timezone', $_zp_server_timezone);
    error_reporting($level);
    }
    /* Timezone Fix End */
  • Thanks for the confirmation. I think we will put this in the config file for the formal fix, though.
Sign In or Register to comment.