[Scummvm-cvs-logs] SF.net SVN: scummvm:[40928] web/trunk/include/Controller.php

fredrik_w at users.sourceforge.net fredrik_w at users.sourceforge.net
Tue May 26 23:14:54 CEST 2009


Revision: 40928
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40928&view=rev
Author:   fredrik_w
Date:     2009-05-26 21:14:54 +0000 (Tue, 26 May 2009)

Log Message:
-----------
Strip ASCII character 194 as it results in a weird character being printed out in the FAQPage (#5_9).

Modified Paths:
--------------
    web/trunk/include/Controller.php

Modified: web/trunk/include/Controller.php
===================================================================
--- web/trunk/include/Controller.php	2009-05-26 21:13:36 UTC (rev 40927)
+++ web/trunk/include/Controller.php	2009-05-26 21:14:54 UTC (rev 40928)
@@ -21,7 +21,7 @@
 	 * to what's been specified in config.inc.
 	 */
 	public function __construct() {
-		/* Create a Smarty object */
+		/* Create a Smarty object. */
 		$this->_smarty = new Smarty();
 		/* Configure smarty. */
 		$this->_smarty->template_dir = SMARTY_DIR_TEMPLATE;
@@ -56,12 +56,13 @@
 		$this->_content = '';
 
 		/* Set up the common variables before displaying. */
+		$menus = MenuModel::getAllMenus();
 		$vars = array(
 			'release' => RELEASE,
 			'release_tag' => RELEASE_TAG,
 			'baseurl' => URL_BASE,
 			'heroes_num' => HEROES_NUM,
-			'menus' => MenuModel::getAllMenus(),
+			'menus' => $menus,
 		);
 		$this->_smarty->assign($vars);
 	}
@@ -70,8 +71,12 @@
 	public function outputFilter($string, &$smarty) {
 		/* Properly encode all ampersands as "&". */
 		$string = preg_replace('/&(?!([a-z]+|(#\d+));)/', '&', $string);
-		/* Replace weird character that appears in some of the data. */
-		$string = str_replace(chr(160), ' ', $string);
+		/* Replace weird characters that appears in some of the data. */
+		$string = str_replace(
+			array(chr(160), chr(194)), 
+			array(' ', ''), 
+			$string
+		);
 		return $string;
 	}
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list