Code Duplication    Length = 6-6 lines in 4 locations

engine/lib/output.php 1 location

@@ 561-566 (lines=6) @@
558
 */
559
function _elgg_get_display_query($string) {
560
	//encode <,>,&, quotes and characters above 127
561
	if (function_exists('mb_convert_encoding')) {
562
		$display_query = mb_convert_encoding($string, 'HTML-ENTITIES', 'UTF-8');
563
	} else {
564
		// if no mbstring extension, we just strip characters
565
		$display_query = preg_replace("/[^\x01-\x7F]/", "", $string);
566
	}
567
	return htmlspecialchars($display_query, ENT_QUOTES, 'UTF-8', false);
568
}
569

mod/search/views/default/search/search_box.php 1 location

@@ 23-28 (lines=6) @@
20
21
// @todo - create function for sanitization of strings for display in 1.8
22
// encode <,>,&, quotes and characters above 127
23
if (function_exists('mb_convert_encoding')) {
24
	$display_query = mb_convert_encoding($value, 'HTML-ENTITIES', 'UTF-8');
25
} else {
26
	// if no mbstring extension, we just strip characters
27
	$display_query = preg_replace("/[^\x01-\x7F]/", "", $value);
28
}
29
30
// render placeholder separately so it will double-encode if needed
31
$placeholder = htmlspecialchars(elgg_echo('search'), ENT_QUOTES, 'UTF-8');

mod/wet4/views/default/search/search_box.php 1 location

@@ 27-32 (lines=6) @@
24
25
// @todo - create function for sanitization of strings for display in 1.8
26
// encode <,>,&, quotes and characters above 127
27
if (function_exists('mb_convert_encoding')) {
28
	$display_query = mb_convert_encoding($value, 'HTML-ENTITIES', 'UTF-8');
29
} else {
30
	// if no mbstring extension, we just strip characters
31
	$display_query = preg_replace("/[^\x01-\x7F]/", "", $value);
32
}
33
34
// render placeholder separately so it will double-encode if needed
35
$placeholder = htmlspecialchars(elgg_echo('search'), ENT_QUOTES, 'UTF-8');

mod/wet4_collab/views/default/search/search_box.php 1 location

@@ 27-32 (lines=6) @@
24
25
// @todo - create function for sanitization of strings for display in 1.8
26
// encode <,>,&, quotes and characters above 127
27
if (function_exists('mb_convert_encoding')) {
28
	$display_query = mb_convert_encoding($value, 'HTML-ENTITIES', 'UTF-8');
29
} else {
30
	// if no mbstring extension, we just strip characters
31
	$display_query = preg_replace("/[^\x01-\x7F]/", "", $value);
32
}
33
34
// render placeholder separately so it will double-encode if needed
35
$placeholder = htmlspecialchars(elgg_echo('search'), ENT_QUOTES, 'UTF-8');