Code Duplication    Length = 13-13 lines in 2 locations

ecrire/inc/filtres_mini.php 2 locations

@@ 163-175 (lines=13) @@
160
* @param bool $double_encode
161
* @return string
162
*/
163
function spip_htmlspecialchars($string, $flags=null, $encoding='ISO-8859-1', $double_encode = true){
164
	if (is_null($flags)) {
165
		if (!defined('PHP_VERSION_ID') OR PHP_VERSION_ID < 50400)
166
			$flags = ENT_COMPAT;
167
		else
168
			$flags = ENT_COMPAT|ENT_HTML401;
169
	}
170
171
	if (!defined('PHP_VERSION_ID') OR PHP_VERSION_ID < 50203)
172
		return htmlspecialchars($string,$flags,$encoding);
173
	else
174
		return htmlspecialchars($string,$flags,$encoding,$double_encode);
175
}
176
177
/**
178
* htmlentities wrapper (PHP >= 5.4 compat issue)
@@ 186-198 (lines=13) @@
183
* @param bool $double_encode
184
* @return string
185
*/
186
function spip_htmlentities($string,$flags=null,$encoding = 'ISO-8859-1',$double_encode = true){
187
	if (is_null($flags)) {
188
		if (!defined('PHP_VERSION_ID') OR PHP_VERSION_ID < 50400)
189
			$flags = ENT_COMPAT;
190
		else
191
			$flags = ENT_COMPAT|ENT_HTML401;
192
	}
193
194
	if (!defined('PHP_VERSION_ID') OR PHP_VERSION_ID < 50203)
195
		return htmlentities($string,$flags,$encoding);
196
	else
197
		return htmlentities($string,$flags,$encoding,$double_encode);
198
}
199
?>
200