Don't use error suppression on realpath() + style adjustments
diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php
index 76e1735..af14dfe 100644
--- a/system/helpers/text_helper.php
+++ b/system/helpers/text_helper.php
@@ -157,8 +157,8 @@
 				if (count($temp) === $count)
 				{
 					$number = ($count === 3)
-							? (($temp[0] % 16) * 4096) + (($temp[1] % 64) * 64) + ($temp[2] % 64)
-							: (($temp[0] % 32) * 64) + ($temp[1] % 64);
+						? (($temp[0] % 16) * 4096) + (($temp[1] % 64) * 64) + ($temp[2] % 64)
+						: (($temp[0] % 32) * 64) + ($temp[1] % 64);
 
 					$out .= '&#'.$number.';';
 					$count = 1;
@@ -220,9 +220,11 @@
 
 		if ($all)
 		{
-			return str_replace(array('&', '<', '>', '"', ''', '-'),
-						array('&', '<', '>', '"', "'", '-'),
-						$str);
+			return str_replace(
+				array('&amp;', '&lt;', '&gt;', '&quot;', '&apos;', '&#45;'),
+				array('&', '<', '>', '"', "'", '-'),
+				$str
+			);
 		}
 
 		return $str;
@@ -297,31 +299,37 @@
 		 * so they don't accidentally break the string out of PHP,
 		 * and thus, thwart the highlighting.
 		 */
-		$str = str_replace(array('&lt;', '&gt;', '<?', '?>', '<%', '%>', '\\', '</script>'),
-					array('<', '>', 'phptagopen', 'phptagclose', 'asptagopen', 'asptagclose', 'backslashtmp', 'scriptclose'),
-					$str);
+		$str = str_replace(
+			array('&lt;', '&gt;', '<?', '?>', '<%', '%>', '\\', '</script>'),
+			array('<', '>', 'phptagopen', 'phptagclose', 'asptagopen', 'asptagclose', 'backslashtmp', 'scriptclose'),
+			$str
+		);
 
 		// The highlight_string function requires that the text be surrounded
 		// by PHP tags, which we will remove later
 		$str = highlight_string('<?php '.$str.' ?>', TRUE);
 
 		// Remove our artificially added PHP, and the syntax highlighting that came with it
-		$str = preg_replace(array(
-						'/<span style="color: #([A-Z0-9]+)">&lt;\?php(&nbsp;| )/i',
-						'/(<span style="color: #[A-Z0-9]+">.*?)\?&gt;<\/span>\n<\/span>\n<\/code>/is',
-						'/<span style="color: #[A-Z0-9]+"\><\/span>/i'
-					),
-					array(
-						'<span style="color: #$1">',
-						"$1</span>\n</span>\n</code>",
-						''
-					),
-					$str);
+		$str = preg_replace(
+			array(
+				'/<span style="color: #([A-Z0-9]+)">&lt;\?php(&nbsp;| )/i',
+				'/(<span style="color: #[A-Z0-9]+">.*?)\?&gt;<\/span>\n<\/span>\n<\/code>/is',
+				'/<span style="color: #[A-Z0-9]+"\><\/span>/i'
+			),
+			array(
+				'<span style="color: #$1">',
+				"$1</span>\n</span>\n</code>",
+				''
+			),
+			$str
+		);
 
 		// Replace our markers back to PHP tags.
-		return str_replace(array('phptagopen', 'phptagclose', 'asptagopen', 'asptagclose', 'backslashtmp', 'scriptclose'),
-					array('&lt;?', '?&gt;', '&lt;%', '%&gt;', '\\', '&lt;/script&gt;'),
-					$str);
+		return str_replace(
+			array('phptagopen', 'phptagclose', 'asptagopen', 'asptagclose', 'backslashtmp', 'scriptclose'),
+			array('&lt;?', '?&gt;', '&lt;%', '%&gt;', '\\', '&lt;/script&gt;'),
+			$str
+		);
 	}
 }
 
@@ -408,10 +416,7 @@
 	function word_wrap($str, $charlim = 76)
 	{
 		// Set the character limit
-		if ( ! is_numeric($charlim))
-		{
-			$charlim = 76;
-		}
+		is_numeric($charlim) OR $charlim = 76;
 
 		// Reduce multiple spaces
 		$str = preg_replace('| +|', ' ', $str);