From 2175421d424b17bbeb5ec4eb020c74db23cbc1a3 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 1 Mar 2012 09:30:49 +0000 Subject: [PATCH] added "custom" (custom instance-specific translations) to apps which have to use home as app-name, also moved sanitrary checks before header-include --- phpgwapi/lang.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/phpgwapi/lang.php b/phpgwapi/lang.php index 607f61e714..2cb8b6c3ea 100644 --- a/phpgwapi/lang.php +++ b/phpgwapi/lang.php @@ -11,9 +11,13 @@ * @version $Id$ */ +// just to be sure, noone tries something nasty ... +if (!preg_match('/^[a-z0-9_]+$/i', $_GET['app'])) die('No valid application-name given!'); +if (!preg_match('/^[a-z]{2}(-[a-z]{2})?$/i', $_GET['lang'])) die('No valid lang-name given!'); + $GLOBALS['egw_info'] = array( 'flags' => array( - 'currentapp' => in_array($_GET['app'],array('etemplate','common')) ? 'home' : $_GET['app'], + 'currentapp' => in_array($_GET['app'],array('etemplate','common','custom')) ? 'home' : $_GET['app'], 'noheader' => true, 'load_translations' => false, // do not automatically load translations 'nocachecontrol' => true, @@ -22,10 +26,6 @@ $GLOBALS['egw_info'] = array( include '../header.inc.php'; -// just to be sure, noone tries something nasty ... -if (!preg_match('/^[a-z0-9_]+$/i', $_GET['app'])) die('No valid application-name given!'); -if (!preg_match('/^[a-z]{2}(-[a-z]{2})?$/i', $_GET['lang'])) die('No valid lang-name given!'); - // use an etag with app, lang and a hash over the creation-times of all lang-files $etag = '"'.$_GET['app'].'-'.$_GET['lang'].'-'.md5(serialize($GLOBALS['egw_info']['server']['lang_ctimes'])).'"';