Subversion-Projekte lars-tiefland.ci

Revision

Revision 2049 | Revision 2242 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 2049 Revision 2107
Zeile 136... Zeile 136...
136
	 * @return	string
136
	 * @return	string
137
	 */
137
	 */
138
	function ascii_to_entities($str)
138
	function ascii_to_entities($str)
139
	{
139
	{
140
		$out = '';
140
		$out = '';
-
 
141
		$length = defined('MB_OVERLOAD_STRING')
-
 
142
			? mb_strlen($str, '8bit') - 1
-
 
143
			: strlen($str) - 1;
141
		for ($i = 0, $s = strlen($str) - 1, $count = 1, $temp = array(); $i <= $s; $i++)
144
		for ($i = 0, $count = 1, $temp = array(); $i <= $length; $i++)
142
		{
145
		{
143
			$ordinal = ord($str[$i]);
146
			$ordinal = ord($str[$i]);
Zeile 144... Zeile 147...
144
 
147
 
145
			if ($ordinal < 128)
148
			if ($ordinal < 128)
Zeile 174... Zeile 177...
174
					$out .= '&#'.$number.';';
177
					$out .= '&#'.$number.';';
175
					$count = 1;
178
					$count = 1;
176
					$temp = array();
179
					$temp = array();
177
				}
180
				}
178
				// If this is the last iteration, just output whatever we have
181
				// If this is the last iteration, just output whatever we have
179
				elseif ($i === $s)
182
				elseif ($i === $length)
180
				{
183
				{
181
					$out .= '&#'.implode(';', $temp).';';
184
					$out .= '&#'.implode(';', $temp).';';
182
				}
185
				}
183
			}
186
			}
184
		}
187
		}