Index: branches/unlabeled/unlabeled-1.100.2/kernel/parser.php =================================================================== diff -u -r5651 -r5980 --- branches/unlabeled/unlabeled-1.100.2/kernel/parser.php (.../parser.php) (revision 5651) +++ branches/unlabeled/unlabeled-1.100.2/kernel/parser.php (.../parser.php) (revision 5980) @@ -189,7 +189,7 @@ global $var_list, $objSession, $objUsers, $objTemplate; $userid = $objSession->Get('PortalUserId'); - + if ($userid <= 0) { if ( getArrayValue($attribs, '_logintemplate')) { $t = $objTemplate->ParseTemplate($attribs['_logintemplate']); @@ -233,7 +233,7 @@ function m_subscribe_address() { global $objSession; - + return $objSession->GetVariable('SubscribeAddress'); } @@ -797,7 +797,7 @@ $FormValues[$FormName]["country"] = $u->Get("Country"); $FormValues[$FormName]["minpwresetdelay"] = $u->Get("MinPwResetDelay"); - + // $FormValues[$FormName]["dob"] = LangDate($u->Get("dob"), 0, true); $FormValues[$FormName]["dob_day"] = adodb_date("d", $u->Get("dob")); $FormValues[$FormName]["dob_year"] = adodb_date("Y", $u->Get("dob")); @@ -1261,7 +1261,7 @@ $application =& kApplication::Instance(); $ml_formatter =& $application->recallObject('kMultiLanguage'); $path = $c->Get($ml_formatter->LangFieldName('CachedNavbar')); - + if (strlen($path)) { $ret .= " - ".str_replace('&|&', ' > ', $path); } @@ -1711,14 +1711,14 @@ // echo "TEST:
$sql
\n"; $objSearchCats->Query_Item($sql); $where = "ItemType=1"; - + $Keywords = GetKeywords($objSession->GetVariable("Search_Keywords")); //echo "SQL Loaded ItemCount (".get_class($this).'): '.$this->NumItems().'
'; for($i = 0; $i < $objSearchCats->NumItems(); $i++) { $objSearchCats->Items[$i]->Keywords = $Keywords; } - + if(is_numeric($CountVal[1])) { $objSearchCats->QueryItemCount = $CountVal[1]; @@ -2927,21 +2927,21 @@ function m_meta_keywords($attribs = array()) { global $objCatList, $objConfig; - + $keywords = ''; $catid = (int)getArrayValue($attribs, '_catid'); - + if (!$catid) { $catid = $objCatList->CurrentCategoryID(); } - + if ($catid) { $c = $objCatList->GetItem($catid); $keywords = $c->Get('MetaKeywords'); } - + if (!$keywords) { $keywords = $objConfig->Get('Category_MetaKey'); @@ -2963,13 +2963,13 @@ { $catid = $objCatList->CurrentCategoryID(); } - + if ($catid) { $c = $objCatList->GetItem($catid); $description = $c->Get('MetaDescription'); } - + if (!$description) { $description = $objConfig->Get('Category_MetaDesc'); @@ -3725,7 +3725,7 @@ function m_IsDebugMode($params) { - echo 'kool'; +// echo 'kool'; return IsDebugMode() ? true : ''; } @@ -3734,64 +3734,64 @@ $parser_params = GetVar('parser_params'); $param_name = strtolower($params['_name']); $value = getArrayValue($parser_params, $param_name); - + if ($value) { if (getArrayValue($params, '_asphrase')) { $value = language($value); } } - + return $value; } function m_set_category($params) { global $m_var_list; - + if (getArrayValue($params, '_onlyonce') && $m_var_list['cat']) return ; - + $db =& GetADODBConnection(); $category_id = getArrayValue($params, '_catid'); if (!$category_id) { $module = getArrayValue($params, '_module'); if ($module) { - + $sql = 'SELECT RootCat FROM '.GetTablePrefix().'Modules WHERE LOWER(Name) = '.$db->qstr( strtolower($module) ); $category_id = $db->GetOne($sql); } } - + if ($category_id) { $m_var_list['cat'] = $category_id; } } - + function m_template_equals($params) { $t = preg_replace('/(.*)\.tpl/', '\\1', $params['_template']); return $GLOBALS['var_list']['t'] == $t ? true : ''; } - + function m_ShowSearchError($params) { global $objSession, $objTemplate; - + $error_phrase = $objSession->GetVariable('search_error'); if (!$error_phrase) { return ''; } - + $template = getArrayValue($params, '_itemtemplate'); if (!$template) { $ret = ''; } - + $ret = $objTemplate->GetTemplate($template, true); $ret = $ret->source; - + return str_replace('', language($error_phrase), $ret); } - + /*function m_object($attribs=Array()) { $element = new clsHtmlTag(); Index: branches/unlabeled/unlabeled-1.24.2/core/kernel/parser/template_parser.php =================================================================== diff -u -r5963 -r5980 --- branches/unlabeled/unlabeled-1.24.2/core/kernel/parser/template_parser.php (.../template_parser.php) (revision 5963) +++ branches/unlabeled/unlabeled-1.24.2/core/kernel/parser/template_parser.php (.../template_parser.php) (revision 5980) @@ -267,6 +267,16 @@ } $close_len = strlen($closing_tag); + + // Cutting trailing line-breaks after tags (same way PHP does it) + if (substr($this->Template, $tag_close_pos+$close_len, 2) == "\r\n") { + $this->Template = substr_replace($this->Template, '', $tag_close_pos, 2); + } + elseif (substr($this->Template, $tag_close_pos+$close_len, 1) == "\n") { + $this->Template = substr_replace($this->Template, '', $tag_close_pos, 1); + } + + //Cutting out the tag itself $tag = substr($this->Template, $tag_open_pos + $open_len, $tag_close_pos - $tag_open_pos - $open_len);