Project

General

Profile

« Previous | Next » 

Revision 1464

Added by DarkViper almost 13 years ago

fixed little bug in moveCssToHead()

View differences:

branches/2.8.x/CHANGELOG
11 11
! = Update/Change
12 12

  
13 13
------------------------------------- 2.8.2 ------------------------------------
14
01 Jun-2011 Build 1464 Werner v.d.Decken(DarkViper)
15
# fixed little bug in moveCssToHead()
14 16
01 Jul-2011 Build 1463 Dietmar Woellbrink (Luisehahne)
15 17
# fixed Ticket 1050 Bug in include/phpmailer/class.phpmailer.php with Lotus Notes
16 18
# fixed Ticket 573, 939 Bad formatting of e-mail received from form submissions
branches/2.8.x/wb/admin/interface/version.php
52 52

  
53 53
// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
54 54
if(!defined('VERSION')) define('VERSION', '2.8.2.RC6');
55
if(!defined('REVISION')) define('REVISION', '1463');
55
if(!defined('REVISION')) define('REVISION', '1464');
56 56

  
57 57
?>
branches/2.8.x/wb/framework/frontend.functions.php
595 595

  
596 596
	function moveCssToHead($content) {
597 597
		// move css definitions into head section
598
		$pattern1 = '/(?:.*?<body.*?)(<link[^>]*?\"text\/css\".*?\/>)(?:.*)/si';
599
		$pattern2 = '/(?:.*?<body.*?)(<style[^>]*?\"text\/css\"[^>]*?>.*?<\/style>)(?:.*)/si';
600
		$insert1 = array();
601
		$insert2 = array();
602
		if(preg_match_all($pattern1, $content, $matches)) {
603
			$insert1 = $matches[1];
604
			$content = str_replace($insert1, '', $content);
598
		$pattern1 = '/(?:<body.*?)(<link[^>]*?\"text\/css\".*?\/>)/si';
599
		$pattern2 = '/(?:<body.*?)(<style[^>]*?\"text\/css\"[^>]*?>.*?<\/style>)/si';
600
		while(preg_match($pattern1, $content, $matches)==1) {
601
		// loop through all linked CSS
602
			$insert = $matches[1];
603
			$content = str_replace($insert, '', $content);
604
			$insert = "\n".$insert."\n</head>\n<body";
605
			$content = preg_replace('/<\/head>.*?<body/si', $insert, $content);
605 606
		}
606
		if(preg_match_all($pattern2, $content, $matches)) {
607
			$insert2 = $matches[1];
608
			$content = str_replace($insert2, '', $content);
607
		while(preg_match($pattern2, $content, $matches)==1) {
608
		// loop through all inline CSS
609
			$insert = $matches[1];
610
			$content = str_replace($insert, '', $content);
611
			$insert = "\n".$insert."\n</head>\n<body";
612
			$content = preg_replace('/<\/head>.*?<body/si', $insert, $content);
609 613
		}
610
		$insert = array_merge($insert1, $insert2);
611
		$insert = "\n".implode("\n", $insert)."\n</head>\n<body";
612
		$content = preg_replace('/<\/head>.*?<body/si', $insert, $content);
613 614
		return $content;
614 615
	}
615 616

  
......
627 628
		// Get the pages submenu
628 629
		$menu2 = $database->query("SELECT page_id,menu_title,page_title,link,target,visibility$extra_sql FROM ".TABLE_PREFIX."pages WHERE parent = '".PARENT."' AND $extra_where_sql ORDER BY position ASC");
629 630
	}
630
// End WB < 2.4.x template compatibility code
631
// Include template file
632 631

  

Also available in: Unified diff