Skip to content

Commit

Permalink
Merge pull request PrestaShop#5112 from xGouley/install_mod_rewrite
Browse files Browse the repository at this point in the history
// Fix timezone check after mod_rewrite check
  • Loading branch information
Julien Martin committed Mar 3, 2016
2 parents 1a52b80 + fa05ceb commit 7978d82
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
17 changes: 16 additions & 1 deletion install-dev/classes/controllerHttp.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,22 @@ final public static function execute()

// Set timezone
if ($session->shop_timezone) {
@date_default_timezone_set($session->shop_timezone);
try {
// Search if the session timezone is known in the present zones list.
// An unknown timezone can be stored here, in case of upgrade of PHP version (change in many timezones, as disappeared US/Eastern for example).
foreach (DateTimeZone::listAbbreviations() as $abbreviations) {
foreach ($abbreviations as $abbreviation) {
if ($session->shop_timezone == $abbreviation['timezone_id']) {
@date_default_timezone_set($session->shop_timezone);
break 2;
}
}
}
// If not know, does not affect PHP settings. Another default setting is forced before.
} catch (\Exception $e) {
// for older behavior, keep old way to affect timezone.
@date_default_timezone_set($session->shop_timezone);
}
}

// Get current step (check first if step is changed, then take it from session)
Expand Down
2 changes: 1 addition & 1 deletion install-dev/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@

@set_time_limit(0);
if (!@ini_get('date.timezone')) {
@date_default_timezone_set('UTC');
@date_default_timezone_set('Europe/Paris');
}

// Try to improve memory limit if it's under 64M
Expand Down
Binary file added install-dev/theme/img/pict_warning.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions install-dev/theme/view.css
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,9 @@ ul#optional {
background: #f8eba8 url(img/pict_error.png) no-repeat 99% 8px;
padding-right: 20px;
}
ul#optional li.fail {
background: #f8eba8 url(img/pict_warning.gif) no-repeat 99% 8px;
}

/* ETAPE 3 - DB ************************************************************* */
#sheet_database {
Expand Down

0 comments on commit 7978d82

Please sign in to comment.