mirror of
https://github.com/wallabag/wallabag.git
synced 2024-12-17 02:39:24 +01:00
Merge pull request #1468 from wallabag/v2-fix-detect-theme
fix bug on detect active theme
This commit is contained in:
commit
3bfbd22f13
@ -42,7 +42,13 @@ class DetectActiveTheme implements DeviceDetectionInterface
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
$user = $this->securityContext->getToken()->getUser();
|
||||
$token = $this->securityContext->getToken();
|
||||
|
||||
if (is_null($token)) {
|
||||
return $this->defaultTheme;
|
||||
}
|
||||
|
||||
$user = $token->getUser();
|
||||
|
||||
if (!$user instanceof User) {
|
||||
return $this->defaultTheme;
|
||||
|
@ -10,8 +10,8 @@ class WallabagExtensionTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$extension = new WallabagExtension();
|
||||
|
||||
$this->assertEquals("lemonde.fr", $extension->removeWww('www.lemonde.fr'));
|
||||
$this->assertEquals("lemonde.fr", $extension->removeWww('lemonde.fr'));
|
||||
$this->assertEquals("gist.github.com", $extension->removeWww('gist.github.com'));
|
||||
$this->assertEquals('lemonde.fr', $extension->removeWww('www.lemonde.fr'));
|
||||
$this->assertEquals('lemonde.fr', $extension->removeWww('lemonde.fr'));
|
||||
$this->assertEquals('gist.github.com', $extension->removeWww('gist.github.com'));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user