Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixes fatal error when intl module is not installed.
  • Loading branch information
drm committed Jul 10, 2011
1 parent 5d1f5b1 commit 9714cfc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Symfony/Component/HttpFoundation/Session.php
Expand Up @@ -355,10 +355,14 @@ public function unserialize($serialized)

private function setPhpDefaultLocale($locale)
{
// if either the class Locale doesn't exist, or an exception is thrown when
// setting the default locale, the intl module is not installed, and
// the call can be ignored:
try {
\Locale::setDefault($this->locale);
if (class_exists('Locale', false)) {
\Locale::setDefault($locale);
}
} catch (\Exception $e) {
// means that intl is not installed.
}
}
}

0 comments on commit 9714cfc

Please sign in to comment.