<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -150,7 +150,6 @@ $smarty-&gt;assign('header_name', $themeObject-&gt;ShowHeader('addtemplate'));
 $smarty-&gt;assign_by_ref('template_object', $template_object);
 
 $smarty-&gt;assign('content_box', create_textarea(false, $template_object-&gt;content, 'template[content]', 'pagebigtextarea', '', $template_object-&gt;encoding));
-$smarty-&gt;assign('encoding_dropdown', create_encoding_dropdown('template[encoding]', $template_object-&gt;encoding));
 
 //extra buttons
 $ExtraButtons = array(</diff>
      <filename>admin/addtemplate.php</filename>
    </modified>
    <modified>
      <diff>@@ -110,7 +110,6 @@ $smarty-&gt;assign('header_name', $themeObject-&gt;ShowHeader('edittemplate'));
 $smarty-&gt;assign_by_ref('template_object', $template_object);
 
 $smarty-&gt;assign('content_box', create_textarea(false, $template_object-&gt;content, 'template[content]', 'pagebigtextarea', '', $template_object-&gt;encoding));
-$smarty-&gt;assign('encoding_dropdown', create_encoding_dropdown('template[encoding]', $template_object-&gt;encoding));
 
 //extra buttons
 $ExtraButtons = array(</diff>
      <filename>admin/edittemplate.php</filename>
    </modified>
    <modified>
      <diff>@@ -50,7 +50,7 @@ $themeObject-&gt;DisplayDashboardCallout(dirname(dirname(__FILE__)) . '/install');
 $themeObject-&gt;DisplayDashboardCallout(TMP_CACHE_LOCATION . '/SITEDOWN', lang('sitedownwarning', TMP_CACHE_LOCATION . '/SITEDOWN'));
 
 // Display a warning if safe mode is enabled
-if( ini_get_boolean('safe_mode') &amp;&amp; CmsApplication::get_preference(('disablesafemodewarning',0) == 0 )
+if( ini_get_boolean('safe_mode') &amp;&amp; CmsApplication::get_preference('disablesafemodewarning',0) == 0 )
   {
     echo '&lt;div class=&quot;pageerrorcontainer&quot;&gt;&lt;div class=&quot;pageoverflow&quot;&gt;&lt;p class=&quot;pageerror&quot;&gt;'.lang('warning_safe_mode').'&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;';
   }</diff>
      <filename>admin/index.php</filename>
    </modified>
    <modified>
      <diff>@@ -473,7 +473,7 @@ $smarty-&gt;assign('lang_list', $lang_list);
 			  while (($file = readdir($dir)) !== false) {
 				  	if (@is_dir(&quot;themes/&quot;.$file) &amp;&amp; ($file[0]!='.')) {
 			?&gt;
-		  		&lt;option value=&quot;&lt;?php echo $file?&gt;&quot;&lt;?php echo (CmsApplication::get_preference(('logintheme', 'default')==$file?&quot; selected=\&quot;selected\&quot;&quot;:&quot;&quot;)?&gt;&gt;&lt;?php echo $file?&gt;&lt;/option&gt;				  
+		  		&lt;option value=&quot;&lt;?php echo $file?&gt;&quot;&lt;?php echo (CmsApplication::get_preference('logintheme', 'default')==$file?&quot; selected=\&quot;selected\&quot;&quot;:&quot;&quot;)?&gt;&gt;&lt;?php echo $file?&gt;&lt;/option&gt;				  
 				  &lt;?php
 		  	}
 		  }</diff>
      <filename>admin/siteprefs.php</filename>
    </modified>
    <modified>
      <diff>@@ -22,18 +22,12 @@
 		    {/if}
 		&lt;/div&gt;
 		&lt;div id=&quot;advanced&quot;&gt;
-			{* Encoding *}
-			&lt;div class=&quot;row&quot;&gt;
-				&lt;label&gt;{lang string='encoding'}:&lt;/label&gt;
-	 		    {$encoding_dropdown}
-			&lt;/div&gt;
-	
-	    {* Active *}
-		{admin_input type='checkbox' label='active' id='template_active' name='template[active]' selected=$template_object-&gt;active}	
+		    {* Active *}
+			{admin_input type='checkbox' label='active' id='template_active' name='template[active]' selected=$template_object-&gt;active}	
    
-	    {html_hidden name='is_postback' value='true'}
-	    {html_hidden name='template[id]' value=$template_object-&gt;id}
-	    {html_hidden name='template_id' value=$template_object-&gt;id}
+		    {html_hidden name='is_postback' value='true'}
+		    {html_hidden name='template[id]' value=$template_object-&gt;id}
+		    {html_hidden name='template_id' value=$template_object-&gt;id}
 		&lt;/div&gt;
 	&lt;/div&gt;&lt;!-- End Tabs --&gt;
 	{include file='elements/buttons.tpl'}</diff>
      <filename>admin/templates/addtemplate.tpl</filename>
    </modified>
    <modified>
      <diff>@@ -50,7 +50,7 @@ CmsContentOperations::find_content_types();
 CmsContentOperations::find_block_types();
 
 #Set a umask
-$global_umask = CmsApplication::get_preference(('global_umask','');
+$global_umask = CmsApplication::get_preference('global_umask','');
 if( $global_umask != '' )
 {
 	@umask( octdec($global_umask) );
@@ -58,7 +58,7 @@ if( $global_umask != '' )
 
 #Set the locale if it's set
 #either in the config, or as a site preference.
-$frontendlang = CmsApplication::get_preference(('frontendlang','');
+$frontendlang = CmsApplication::get_preference('frontendlang','');
 if (CmsConfig::exists('locale') &amp;&amp; CmsConfig::get('locale') != '')
 {
     $frontendlang = CmsConfig::get('locale');</diff>
      <filename>include.php</filename>
    </modified>
    <modified>
      <diff>@@ -193,7 +193,7 @@ if (CmsConfig::get('debug'))
 	echo CmsProfiler::get_instance()-&gt;report();
 }
 
-if (CmsApplication::get_preference(('enablesitedownmessage') == &quot;1&quot; || $config['debug'] == true)
+if (CmsApplication::get_preference('enablesitedownmessage') == &quot;1&quot; || $config['debug'] == true)
 {
 	cms_smarty()-&gt;clear_compiled_tpl();
 }</diff>
      <filename>index.php</filename>
    </modified>
    <modified>
      <diff>@@ -73,13 +73,13 @@ class CmsPageInfoOperations extends CmsObject
 		else
 		{
 			#Page isn't found.  Should we setup an alternate page?
-			#if (CmsApplication::get_preference(('custom404template') &gt; 0 &amp;&amp; CmsApplication::get_preference(('enablecustom404') == &quot;1&quot;)
-			if (CmsApplication::get_preference(('enablecustom404') == &quot;1&quot;)
+			#if (CmsApplication::get_preference('custom404template') &gt; 0 &amp;&amp; CmsApplication::get_preference('enablecustom404') == &quot;1&quot;)
+			if (CmsApplication::get_preference('enablecustom404') == &quot;1&quot;)
 			{
 				$onepageinfo = new CmsPageInfo();
 				$onepageinfo-&gt;cachable = false;
-				if (CmsApplication::get_preference(('custom404template') &gt; 0)
-					$onepageinfo-&gt;template_id = CmsApplication::get_preference(('custom404template');
+				if (CmsApplication::get_preference('custom404template') &gt; 0)
+					$onepageinfo-&gt;template_id = CmsApplication::get_preference('custom404template');
 				else
 					$onepageinfo-&gt;template_id = 'notemplate';
 				$onepageinfo-&gt;template_modified_date = time();</diff>
      <filename>lib/classes/class.cms_page_info_operations.php</filename>
    </modified>
    <modified>
      <diff>@@ -291,9 +291,9 @@ class CmsSmarty extends Smarty {
 		global $gCms;
 		$config = cms_config();
 
-		if (CmsApplication::get_preference(('enablesitedownmessage') == &quot;1&quot;)
+		if (CmsApplication::get_preference('enablesitedownmessage') == &quot;1&quot;)
 		{
-			$tpl_source = CmsApplication::get_preference(('sitedownmessage');
+			$tpl_source = CmsApplication::get_preference('sitedownmessage');
 			return true;
 		}
 		else
@@ -350,7 +350,7 @@ class CmsSmarty extends Smarty {
 	{
 		global $gCms;
 
-		if (CmsApplication::get_preference(('enablesitedownmessage') == &quot;1&quot; || $tpl_name == 'notemplate')
+		if (CmsApplication::get_preference('enablesitedownmessage') == &quot;1&quot; || $tpl_name == 'notemplate')
 		{
 			$tpl_timestamp = time();
 			return true;
@@ -386,7 +386,7 @@ class CmsSmarty extends Smarty {
 			header(&quot;HTTP/1.0 404 Not Found&quot;);
 			header(&quot;Status: 404 Not Found&quot;);
 			if ($tpl_name == 'default')
-				$tpl_source = CmsApplication::get_preference(('custom404');
+				$tpl_source = CmsApplication::get_preference('custom404');
 			else
 				$tpl_source = '';
 			return true;</diff>
      <filename>lib/classes/class.cms_smarty.php</filename>
    </modified>
    <modified>
      <diff>@@ -94,7 +94,7 @@ class CmsModule extends CmsModuleBase
 		}
 		else
 		{
-		  $this-&gt;curlang = CmsApplication::get_preference(('frontendlang','');
+		  $this-&gt;curlang = CmsApplication::get_preference('frontendlang','');
 		  if (isset($config['locale']) &amp;&amp; $config['locale'] != '') {
 		      $this-&gt;curlang = $config['locale'];
 		    }
@@ -2397,7 +2397,7 @@ class CmsModule extends CmsModuleBase
 	 */
 	function GetPreference($preference_name, $defaultvalue='')
 	{
-		return CmsApplication::get_preference(($this-&gt;GetName() . &quot;_mapi_pref_&quot; . $preference_name, $defaultvalue);
+		return CmsApplication::get_preference($this-&gt;GetName() . &quot;_mapi_pref_&quot; . $preference_name, $defaultvalue);
 	}
 
 	/**</diff>
      <filename>lib/classes/module/class.cms_module.php</filename>
    </modified>
    <modified>
      <diff>@@ -934,7 +934,7 @@ abstract class CmsModuleBase extends CmsObject
 	{
 		if ($returnid != '')
 		{
-			if (!$this-&gt;restrict_unknown_params &amp;&amp; CmsApplication::get_preference(('allowparamcheckwarnings', 0))
+			if (!$this-&gt;restrict_unknown_params &amp;&amp; CmsApplication::get_preference('allowparamcheckwarnings', 0))
 			{
 				trigger_error('WARNING: '.$this-&gt;get_name().' is not properly cleaning input params.', E_USER_WARNING);
 			}
@@ -1783,7 +1783,7 @@ abstract class CmsModuleBase extends CmsObject
 	 */
 	public function get_preference($preference_name, $defaultvalue='')
 	{
-		return CmsApplication::get_preference(($this-&gt;get_name() . &quot;_mapi_pref_&quot; . $preference_name, $defaultvalue);
+		return CmsApplication::get_preference($this-&gt;get_name() . &quot;_mapi_pref_&quot; . $preference_name, $defaultvalue);
 	}
 
 	/**</diff>
      <filename>lib/classes/module/class.cms_module_base.php</filename>
    </modified>
    <modified>
      <diff>@@ -25,82 +25,6 @@
  */
 
 /**
- * Shortcut to the print_r function.
- * Wraps the output in &lt;pre&gt; and &lt;/pre&gt; for easy reading
- * 
- * @param array $var 
- * @param bool $exit
- *
- */
-function pr($var, $exit = 1)
-{
-	echo '&lt;pre&gt;';
-		print_r($var);
-	echo '&lt;/pre&gt;';	
-	if($exit == 1) 	
-		die();
-}
-
-
-/**
- * Simple template parser
- *
- * @since 0.6.1
- */
-function parse_template($template, $tpl_array, $warn=0)
-{
-	while ( list ($key,$val) = each ($tpl_array) )
-	{
-		if (!(empty($key)))
-		{
-			if(gettype($val) != &quot;string&quot;)
-			{
-				settype($val,&quot;string&quot;);
-			}
-			$template = eregi_replace('\{' . $key . '\}',$val,$template);
-		}
-	}
-
-	if(!$warn)
-	{
-		// Silently remove anything not already found
-
-		$template = ereg_replace('\{[A-Z0-9_]+\}', &quot;&quot;, $template);
-	}
-	else
-	{
-		// Warn about unresolved template variables
-		if (ereg('\{[A-Z0-9_]+\}',$template))
-		{
-			$unknown = split(&quot;\n&quot;,$template);
-			while (list ($Element,$Line) = each($unknown) )
-			{
-				$UnkVar = $Line;
-				if(!(empty($UnkVar)))
-				{
-					$this-&gt;show_unknowns($UnkVar);
-				}
-			}
-		}
-	}
-	return $template;
-
-}	// end parse_template();
-
-function cms_html_entities($string, $param=ENT_QUOTES, $charset=&quot;UTF-8&quot;)
-{
-	$result = &quot;&quot;;
-	#$result = htmlentities($string, $param, $charset);
-	$result = my_htmlentities($string);
-	return $result;
-}
-
-function cms_htmlentities($string, $param=ENT_QUOTES, $charset=&quot;UTF-8&quot;)
-{
-	return cms_html_entities($string, $param, $charset);
-}
-
-/**
  * Enter description here...
  *
  * @param unknown $val
@@ -112,215 +36,27 @@ function cms_htmlentities($string, $param=ENT_QUOTES, $charset=&quot;UTF-8&quot;)
  *     ENT_QUOTES   : Will convert both double and single quotes. 
  *     ENT_NOQUOTES : Will leave both double and single quotes unconverted. 
  */
-function my_htmlentities($val)
+function cms_htmlentities($val, $param=ENT_QUOTES, $charset=&quot;UTF-8&quot;)
 {
 	if ($val == &quot;&quot;)
 	{
 		return &quot;&quot;;
 	}
 	$val = str_replace( &quot;&amp;#032;&quot;, &quot; &quot;, $val ); 
-
-	//Remove sneaky spaces 
-	// $val = str_replace( chr(0xCA), &quot;&quot;, $val );   
-
 	$val = str_replace( &quot;&amp;&quot;            , &quot;&amp;amp;&quot;         , $val ); 
 	$val = str_replace( &quot;&lt;!--&quot;         , &quot;&amp;#60;&amp;#33;--&quot;  , $val ); 
 	$val = str_replace( &quot;--&gt;&quot;          , &quot;--&amp;#62;&quot;       , $val ); 
 	$val = preg_replace( &quot;/&lt;script/i&quot;  , &quot;&amp;#60;script&quot;   , $val ); 
 	$val = str_replace( &quot;&gt;&quot;            , &quot;&amp;gt;&quot;          , $val ); 
 	$val = str_replace( &quot;&lt;&quot;            , &quot;&amp;lt;&quot;          , $val ); 
-	
-	
 	$val = str_replace( &quot;\&quot;&quot;           , &quot;&amp;quot;&quot;        , $val ); 
-
-	// Uncomment it if you need to convert literal newlines 
-	//$val = preg_replace( &quot;/\n/&quot;        , &quot;&lt;br&gt;&quot;          , $val ); 
-
 	$val = preg_replace( &quot;/\\$/&quot;      , &quot;&amp;#036;&quot;        , $val ); 
-
-	// Uncomment it if you need to remove literal carriage returns 
-	//$val = preg_replace( &quot;/\r/&quot;        , &quot;&quot;              , $val ); 
-
 	$val = str_replace( &quot;!&quot;            , &quot;&amp;#33;&quot;         , $val ); 
 	$val = str_replace( &quot;'&quot;            , &quot;&amp;#39;&quot;         , $val ); 
 	 
-	// Uncomment if you need to convert unicode chars 
-	//$val = preg_replace(&quot;/&amp;#([0-9]+);/s&quot;, &quot;&amp;#\1;&quot;, $val ); 
-
-	// Strip slashes if not already done so. 
-
-	//if ( get_magic_quotes_gpc() ) 
-	//{ 
-	//	$val = stripslashes($val); 
-	//} 
-
-	// Swop user inputted backslashes 
-
-	//$val = preg_replace( &quot;/\(?!&amp;#|?#)/&quot;, &quot;&amp;#092;&quot;, $val );
-
 	return $val;
 }
 
-
-/**
- * Enter description here...
- *
- * @param unknown $val
- * @return unknown
- */
-function cms_utf8_entities($val)
-{
-	if ($val == &quot;&quot;)
-	{
-		return &quot;&quot;;
-	}
-	$val = str_replace( &quot;&amp;#032;&quot;, &quot; &quot;, $val ); 
-
-	//Remove sneaky spaces 
-	// $val = str_replace( chr(0xCA), &quot;&quot;, $val );   
-
-	$val = str_replace( &quot;&amp;&quot;            , &quot;\u0026&quot;         , $val ); 
-#	$val = str_replace( &quot;&lt;!--&quot;         , &quot;&amp;#60;&amp;#33;--&quot;  , $val ); 
-#	$val = str_replace( &quot;--&gt;&quot;          , &quot;--&amp;#62;&quot;       , $val ); 
-#	$val = preg_replace( &quot;/&lt;script/i&quot;  , &quot;&amp;#60;script&quot;   , $val ); 
-	$val = str_replace( &quot;&gt;&quot;            , &quot;\u003E&quot;          , $val ); 
-	$val = str_replace( &quot;&lt;&quot;            , &quot;\u003C&quot;          , $val ); 
-	
-	
-	$val = str_replace( &quot;\&quot;&quot;           , &quot;\u0022&quot;        , $val ); 
-
-	// Uncomment it if you need to convert literal newlines 
-	//$val = preg_replace( &quot;/\n/&quot;        , &quot;&lt;br&gt;&quot;          , $val ); 
-
-	#$val = preg_replace( &quot;/\\$/&quot;      , &quot;&amp;#036;&quot;        , $val ); 
-
-	// Uncomment it if you need to remove literal carriage returns 
-	//$val = preg_replace( &quot;/\r/&quot;        , &quot;&quot;              , $val ); 
-
-	$val = str_replace( &quot;!&quot;            , &quot;\u0021&quot;         , $val ); 
-	$val = str_replace( &quot;'&quot;            , &quot;\u0027&quot;         , $val ); 
-	 
-	// Uncomment if you need to convert unicode chars 
-	//$val = preg_replace(&quot;/&amp;#([0-9]+);/s&quot;, &quot;&amp;#\1;&quot;, $val ); 
-
-	// Strip slashes if not already done so. 
-
-	//if ( get_magic_quotes_gpc() ) 
-	//{ 
-	//	$val = stripslashes($val); 
-	//} 
-
-	// Swop user inputted backslashes 
-
-	//$val = preg_replace( &quot;/\(?!&amp;#|?#)/&quot;, &quot;&amp;#092;&quot;, $val );
-
-	return $val;
-}
-
-function cms_utf8entities($val)
-{
-	return cms_utf8_entities($val);
-}
-
-//Taken from http://www.webmasterworld.com/forum88/164.htm
-function nl2pnbr( $text )
-{
-	// Use \n for newline on all systems
-	$text = preg_replace(&quot;/(\r\n|\n|\r)/&quot;, &quot;\n&quot;, $text);
-
-	// Only allow two newlines in a row.
-	$text = preg_replace(&quot;/\n\n+/&quot;, &quot;\n\n&quot;, $text);
-
-	// Put &lt;p&gt;..&lt;/p&gt; around paragraphs
-	$text = preg_replace('/\n?(.+?)(\n\n|\z)/s', &quot;&lt;p&gt;$1&lt;/p&gt;&quot;, $text);
-
-	// Convert newlines not preceded by &lt;/p&gt; to a &lt;br /&gt; tag
-	$text = preg_replace('|(?&lt;!&lt;/p&gt;)\s*\n|', &quot;&lt;br /&gt;&quot;, $text);
-
-	return $text;
-}
-
-/**
-* Debug function to display $var nicely in html.
-* 
-* @param mixed $var
-* @param string $title (optional)
-* @param boolean $echo_to_screen (optional)
-* @return string
-*/
-function debug_display($var, $title=&quot;&quot;, $echo_to_screen = true, $use_html = true)
-{
-	global $gCms;
-	$variables =&amp; $gCms-&gt;variables;
-
-	$starttime = microtime();
-	if (isset($variables['starttime']))
-		$starttime = $variables['starttime'];
-	else
-		$variables['starttime'] = $starttime;
-	
-	$titleText = &quot;Debug: &quot;;
-	if($title)
-	{
-		$titleText = &quot;Debug display of '$title':&quot;;
-	}
-	//$titleText .= '(' . microtime_diff($starttime,microtime()) . ')';
-	
-	if (function_exists('memory_get_usage'))
-	{
-		$titleText .= ' - ('.memory_get_usage().')';
-	}
-
-	ob_start();
-	if ($use_html)
-		echo &quot;&lt;div&gt;&lt;b&gt;$titleText&lt;/b&gt;\n&quot;;
-
-	if(FALSE == empty($var))
-	{
-		if ($use_html)
-		{
-			echo '&lt;pre&gt;';
-		}
-		if(is_array($var))
-		{
-			echo &quot;Number of elements: &quot; . count($var) . &quot;\n&quot;;
-			print_r($var);
-		}
-		elseif(is_object($var))
-		{
-			print_r($var);
-		}
-		elseif(is_string($var))
-		{
-			print_r(htmlentities(str_replace(&quot;\t&quot;, '  ', $var)));
-		}
-		elseif(is_bool($var))
-		{
-			echo $var === true ? 'true' : 'false';
-		}
-		else
-		{
-			print_r($var);
-		}
-		if ($use_html)
-		{
-			echo '&lt;/pre&gt;';
-		}
-	}
-	if ($use_html)
-		echo &quot;&lt;/div&gt;\n&quot;;
-
-	$output = ob_get_contents();
-	ob_end_clean();
-
-	if($echo_to_screen)
-	{
-		echo $output;
-	}
-
-	return $output;
-}
-
 /**
  * Display $var nicely to the $gCms-&gt;errors array if $config['debug'] is set
  *
@@ -329,50 +65,7 @@ function debug_display($var, $title=&quot;&quot;, $echo_to_screen = true, $use_html = true
  */
 function debug_buffer($var, $title=&quot;&quot;)
 {
-	global $gCms;
-	if ($gCms)
-	{
-		$config = cms_config();
-		//debug_to_log($var, $title='');
-		if($config[&quot;debug&quot;] == true)
-		{
-			$gCms-&gt;errors[] = debug_display($var, $title, false, true);
-		}
-	}
-}
-
-function debug_sql($str, $newline)
-{
-	global $gCms;
-	if ($gCms)
-	{
-		$config =&amp; $gCms-&gt;GetConfig();
-		if($config[&quot;debug&quot;] == true)
-		{
-			$gCms-&gt;errors[] = debug_display($str, '', false, true);
-		}
-	}
-}
-
-function create_encoding_dropdown($name = 'encoding', $selected = '')
-{
-	$result = '';
-
-	$encodings = array(''=&gt;'Default','UTF-8'=&gt;'Unicode','ISO-8859-1'=&gt;'Latin 1/West European','ISO-8859-2'=&gt;'Latin 2/Central European','ISO-8859-3'=&gt;'Latin 3/South European','ISO-8859-4'=&gt;'Latin 4/North European','ISO-8859-5'=&gt;'Cyrilic','ISO-8859-6'=&gt;'Arabic','ISO-8859-7'=&gt;'Greek','ISO-8859-8'=&gt;'Hebrew','ISO-8859-9'=&gt;'Latin 5/Turkish','ISO-8859-11'=&gt;'TIS-620/Thai','ISO-8859-14'=&gt;'Latin 8','ISO-8859-15'=&gt;'Latin 9','Big5'=&gt;'Taiwanese','GB2312'=&gt;'Chinese','EUC-JP'=&gt;'Japanese','EUC-KR'=&gt;'Korean','KOI8-R'=&gt;'Russian','Windows-1250'=&gt;'Central Europe','Windows-1251'=&gt;'Cyrilic','Windows-1252'=&gt;'Latin 1','Windows-1253'=&gt;'Greek','Windows-1254'=&gt;'Turkish','Windows-1255'=&gt;'Hebrew','Windows-1256'=&gt;'Arabic','Windows-1257'=&gt;'Baltic','Windows-1258'=&gt;'Vietnam');
-
-	$result .= '&lt;select name=&quot;'.$name.'&quot;&gt;';
-	foreach ($encodings as $key=&gt;$value)
-	{
-		$result .= '&lt;option value=&quot;'.$key.'&quot;';
-		if ($selected == $key)
-		{
-			$result .= ' selected=&quot;selected&quot;';
-		}
-		$result .= '&gt;'.$key.($key!=''?' - ':'').$value.'&lt;/option&gt;';
-	}
-	$result .= '&lt;/select&gt;';
-
-	return $result;
+	CmsProfiler::get_instance()-&gt;mark(print_r($var));
 }
 
 function filespec_is_excluded( $file, $excludes )</diff>
      <filename>lib/misc.functions.php</filename>
    </modified>
    <modified>
      <diff>@@ -61,6 +61,12 @@ function generate_user_object($userid)
 	return CmsLogin::generate_user_object($userid);
 }
 
+function check_permission($userid, $permname)
+{
+	return CmsAcl::check_core_permission($permname, $userid);
+}
+
+
 /**
  * Put an event into the audit (admin) log.  This should be
  * done on most admin events for consistency.</diff>
      <filename>lib/page.functions.php</filename>
    </modified>
    <modified>
      <diff>@@ -174,11 +174,11 @@ function smarty_cms_function_sitemap($params, &amp;$smarty)
                 {
                     $menu .= ' target=&quot;' . $onecontent-&gt;GetPropertyValue('target') . '&quot;';
                 }
-                $menu .= '&gt;' . my_htmlentities($onecontent-&gt;MenuText()) . '&lt;/a&gt;';
+                $menu .= '&gt;' . cms_htmlentities($onecontent-&gt;MenuText()) . '&lt;/a&gt;';
             }
             else
             {
-                $menu .= my_htmlentities($onecontent-&gt;MenuText());
+                $menu .= cms_htmlentities($onecontent-&gt;MenuText());
             }
         }
         else</diff>
      <filename>plugins/function.sitemap.php</filename>
    </modified>
    <modified>
      <diff>@@ -18,7 +18,7 @@
 
 function smarty_cms_function_sitename($params, &amp;$smarty)
 {
-	$result = CmsApplication::get_preference(('sitename', 'CMSMS Site');
+	$result = CmsApplication::get_preference('sitename', 'CMSMS Site');
 	if (array_key_exists('assign', $params))
 	{
 		$smarty-&gt;assign($params['assign'], $result);</diff>
      <filename>plugins/function.sitename.php</filename>
    </modified>
    <modified>
      <diff>@@ -108,7 +108,7 @@ function cms_header_filter_plugin_function($params, &amp;$smarty)
 		}
 	}
 	
-	$result .= CmsApplication::get_preference(('metadata', '');
+	$result .= CmsApplication::get_preference('metadata', '');
 
 	if (isset($pageinfo) &amp;&amp; $pageinfo !== FALSE)
 	{</diff>
      <filename>plugins/outputfilter.header.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>1d4e393fe0cae8142711a915f87157611a76f101</id>
    </parent>
  </parents>
  <author>
    <name>wishy</name>
    <email>wishy@3d254a34-79dc-0310-9e5f-be208747d8a0</email>
  </author>
  <url>http://github.com/tedkulp/cmsmadesimple-2-0/commit/5ff950061372f6d3c32f24674eed223a0bdff9f0</url>
  <id>5ff950061372f6d3c32f24674eed223a0bdff9f0</id>
  <committed-date>2008-04-27T07:46:38-07:00</committed-date>
  <authored-date>2008-04-27T07:46:38-07:00</authored-date>
  <message>More page.functions.php and misc.functions.php cleanup -- Probably introduced a few bugs

Signed-off-by: Ted Kulp &lt;ted@cmsmadesimple.org&gt;


git-svn-id: http://svn.cmsmadesimple.org/svn/cmsmadesimple/trunk@4462 3d254a34-79dc-0310-9e5f-be208747d8a0</message>
  <tree>c306865e8d5d7b7a05696d2d643155592c1e4db5</tree>
  <committer>
    <name>wishy</name>
    <email>wishy@3d254a34-79dc-0310-9e5f-be208747d8a0</email>
  </committer>
</commit>
