Project

General

Profile

Actions

Bug #29583

closed

TypoScript condition [userFunc]...[ELSE] does not work correctly

Added by Willi Martens over 12 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Documentation
Target version:
-
Start date:
2011-09-09
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

The following condition always includes both files:

[userFunc = user_match(userAgentIsMobile)]
<INCLUDE_TYPOSCRIPT: source="FILE: fileadmin/res/typoscript/setup/mobile_page.ts">
[else]
<INCLUDE_TYPOSCRIPT: source="FILE: fileadmin/res/typoscript/setup/page.ts">
[global]

The userfunc is defined in localconf.php

function user_match($cmd) {
  switch($cmd) 
  {
    case 'userAgentIsMobile':
      if(preg_match('/(IEMobile|like Mac OS X|Android|BlackBerry|Symbian|LG|NetFront|MIDP|Windows CE|NetFront|PlayStation|PLAYSTATION|MIDP|UP\.Browser|Nintendo)/', t3lib_div::getIndpEnv('HTTP_USER_AGENT'))){
        return TRUE;
      }
      break;
    default:
      return FALSE;
  }
  return FALSE;
}

Seems like the else-condition was ignored completely?

Actions

Also available in: Atom PDF