Skip to content

Commit

Permalink
bug:2835
Browse files Browse the repository at this point in the history
ability detect mobile theme earlier, before plugin load

git-svn-id: http://piwigo.org/svn/trunk@20543 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
patdenice committed Feb 4, 2013
1 parent 3826020 commit b39b4e0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
9 changes: 9 additions & 0 deletions include/functions.inc.php
Expand Up @@ -1621,6 +1621,10 @@ function get_branch_from_version($version)
*/
function get_device()
{
if (session_id() == '')
{
session_start();
}
$device = pwg_get_session_var('device');

if (is_null($device))
Expand Down Expand Up @@ -1657,6 +1661,11 @@ function mobile_theme()
return false;
}

if (session_id() == '')
{
session_start();
}

if (isset($_GET['mobile']))
{
$is_mobile_theme = get_boolean($_GET['mobile']);
Expand Down
5 changes: 4 additions & 1 deletion include/user.inc.php
Expand Up @@ -26,7 +26,10 @@

if (isset($_COOKIE[session_name()]))
{
session_start();
if (session_id() == '')
{
session_start();
}
if (isset($_GET['act']) and $_GET['act'] == 'logout')
{ // logout
logout_user();
Expand Down

0 comments on commit b39b4e0

Please sign in to comment.