Project

General

Profile

« Previous | Next » 

Revision 1420

Added by Dietmar almost 14 years ago

YGN Ethical Hacker Group (2.8.2 / 2.9.0)

View differences:

search_convert.php
1
<?php
2
/**
3
 *
4
 * @category        frontend
5
 * @package         search
6
 * @author          WebsiteBaker Project
7
 * @copyright       2004-2009, Ryan Djurovich
8
 * @copyright       2009-2011, Website Baker Org. e.V.
9
 * @link			http://www.websitebaker2.org/
10
 * @license         http://www.gnu.org/licenses/gpl.html
11
 * @platform        WebsiteBaker 2.8.x
12
 * @requirements    PHP 5.2.2 and higher
13
 * @version         $Id$
14
 * @filesource		$HeadURL$
15
 * @lastmodified    $Date$
16
 *
17
 */
18

  
19
if(!defined('WB_URL')) {
20
	header('Location: ../index.php');
21
	exit(0);
22
}
23
if(!isset($search_lang)) $search_lang = LANGUAGE;
24

  
25
// umlaut to '(upper|lower)' for preg_match()
26
// this is UTF-8-encoded
27
// there is no need for a translation-table anymore since we use u-switch (utf-8) for preg-functions
28
// remember that we use the i-switch, too. [No need for (ae|Ae)]
29

  
30
$string_ul_umlaut = array();
31
$string_ul_regex = array();
32

  
33
// but add some national stuff
34
if($search_lang=='DE') { // add special handling for german umlauts (ä==ae, ...)
35
	$string_ul_umlaut_add = array(
36
		"\xc3\x9f", // german SZ-Ligatur
37
		"\xc3\xa4", // german ae
38
		"\xc3\xb6", // german oe
39
		"\xc3\xbc", // german ue
40
		"\xc3\x84", // german Ae
41
		"\xc3\x96", // german Oe
42
		"\xc3\x9c", // german Ue
43
		// these are not that usual
44
		"\xEF\xAC\x84", // german ffl-ligatur
45
		"ffl",          // german ffl-ligatur
46
		"\xEF\xAC\x83", // german ffi-ligatur
47
		"ffi",          // german ffi-ligatur
48
		"0xEF\xAC\x80", // german ff-Ligatur
49
		"ff",           // german ff-Ligatur
50
		"\xEF\xAC\x81", // german fi-ligatur
51
		"fi",           // german fi-ligatur
52
		"\xEF\xAC\x82", // german fl-ligatur
53
		"fl",           // german fl-ligatur
54
		"\xEF\xAC\x85", // german st-Ligatur (long s)
55
		"st",           // german st-Ligatur
56
		"\xEF\xAC\x86"  // german st-ligatur (round-s)
57
	);
58
	$string_ul_regex_add = array(
59
		"(\xc3\x9f|ss)", // german SZ.Ligatur
60
		"(\xc3\xa4|ae)", // german ae
61
		"(\xc3\xb6|oe)", // german oe
62
		"(\xc3\xbc|ue)", // german ue
63
		"(\xc3\x84|Ae)", // german Ae
64
		"(\xc3\x96|Oe)", // german Oe
65
		"(\xc3\x9c|Ue)", // german Ue
66
		// these are not that usual
67
		"(\xEF\xAC\x84|ffl)", // german ffl-ligatur
68
		"(\xEF\xAC\x84|ffl)", // german ffl-ligatur
69
		"(\xEF\xAC\x83|ffi)", // german ffi-ligatur
70
		"(\xEF\xAC\x83|ffi)", // german ffi-ligatur
71
		"(\xEF\xAC\x80|ff)",  // german ff-Ligatur
72
		"(\xEF\xAC\x80|ff)",  // german ff-Ligatur
73
		"(\xEF\xAC\x81|fi)",  // german fi-Ligatur
74
		"(\xEF\xAC\x81|fi)",  // german fi-Ligatur
75
		"(\xEF\xAC\x82|fl)",  // german fl-ligatur
76
		"(\xEF\xAC\x82|fl)",  // german fl-ligatur
77
		"(\xEF\xAC\x85|st)",  // german st-Ligatur (long s)
78
		"(\xEF\xAC\x85|st|\xEF\xAC\x86)",  // german st-Ligaturs
79
		"(\xEF\xAC\x86|st)"  // german st-ligatur (round-s)
80
	);
81
	$string_ul_umlaut = array_merge($string_ul_umlaut_add, $string_ul_umlaut);
82
	$string_ul_regex = array_merge($string_ul_regex_add, $string_ul_regex);
83
}
84

  
85

  
1
<?php
2
/**
3
 *
4
 * @category        frontend
5
 * @package         search
6
 * @author          WebsiteBaker Project
7
 * @copyright       2004-2009, Ryan Djurovich
8
 * @copyright       2009-2011, Website Baker Org. e.V.
9
 * @link			http://www.websitebaker2.org/
10
 * @license         http://www.gnu.org/licenses/gpl.html
11
 * @platform        WebsiteBaker 2.8.x
12
 * @requirements    PHP 5.2.2 and higher
13
 * @version         $Id$
14
 * @filesource		$HeadURL$
15
 * @lastmodified    $Date$
16
 *
17
 */
18

  
19
// Must include code to stop this file being access directly
20
if(defined('WB_PATH') == false) { die("Cannot access this file directly"); }
21

  
22
if(!isset($search_lang)) $search_lang = LANGUAGE;
23

  
24
// umlaut to '(upper|lower)' for preg_match()
25
// this is UTF-8-encoded
26
// there is no need for a translation-table anymore since we use u-switch (utf-8) for preg-functions
27
// remember that we use the i-switch, too. [No need for (ae|Ae)]
28

  
29
$string_ul_umlaut = array();
30
$string_ul_regex = array();
31

  
32
// but add some national stuff
33
if($search_lang=='DE') { // add special handling for german umlauts (ä==ae, ...)
34
	$string_ul_umlaut_add = array(
35
		"\xc3\x9f", // german SZ-Ligatur
36
		"\xc3\xa4", // german ae
37
		"\xc3\xb6", // german oe
38
		"\xc3\xbc", // german ue
39
		"\xc3\x84", // german Ae
40
		"\xc3\x96", // german Oe
41
		"\xc3\x9c", // german Ue
42
		// these are not that usual
43
		"\xEF\xAC\x84", // german ffl-ligatur
44
		"ffl",          // german ffl-ligatur
45
		"\xEF\xAC\x83", // german ffi-ligatur
46
		"ffi",          // german ffi-ligatur
47
		"0xEF\xAC\x80", // german ff-Ligatur
48
		"ff",           // german ff-Ligatur
49
		"\xEF\xAC\x81", // german fi-ligatur
50
		"fi",           // german fi-ligatur
51
		"\xEF\xAC\x82", // german fl-ligatur
52
		"fl",           // german fl-ligatur
53
		"\xEF\xAC\x85", // german st-Ligatur (long s)
54
		"st",           // german st-Ligatur
55
		"\xEF\xAC\x86"  // german st-ligatur (round-s)
56
	);
57
	$string_ul_regex_add = array(
58
		"(\xc3\x9f|ss)", // german SZ.Ligatur
59
		"(\xc3\xa4|ae)", // german ae
60
		"(\xc3\xb6|oe)", // german oe
61
		"(\xc3\xbc|ue)", // german ue
62
		"(\xc3\x84|Ae)", // german Ae
63
		"(\xc3\x96|Oe)", // german Oe
64
		"(\xc3\x9c|Ue)", // german Ue
65
		// these are not that usual
66
		"(\xEF\xAC\x84|ffl)", // german ffl-ligatur
67
		"(\xEF\xAC\x84|ffl)", // german ffl-ligatur
68
		"(\xEF\xAC\x83|ffi)", // german ffi-ligatur
69
		"(\xEF\xAC\x83|ffi)", // german ffi-ligatur
70
		"(\xEF\xAC\x80|ff)",  // german ff-Ligatur
71
		"(\xEF\xAC\x80|ff)",  // german ff-Ligatur
72
		"(\xEF\xAC\x81|fi)",  // german fi-Ligatur
73
		"(\xEF\xAC\x81|fi)",  // german fi-Ligatur
74
		"(\xEF\xAC\x82|fl)",  // german fl-ligatur
75
		"(\xEF\xAC\x82|fl)",  // german fl-ligatur
76
		"(\xEF\xAC\x85|st)",  // german st-Ligatur (long s)
77
		"(\xEF\xAC\x85|st|\xEF\xAC\x86)",  // german st-Ligaturs
78
		"(\xEF\xAC\x86|st)"  // german st-ligatur (round-s)
79
	);
80
	$string_ul_umlaut = array_merge($string_ul_umlaut_add, $string_ul_umlaut);
81
	$string_ul_regex = array_merge($string_ul_regex_add, $string_ul_regex);
82
}
83

  
84

  
86 85
?>

Also available in: Unified diff