From 95032c0cc91ced9283ca442d641ae401dd15f23e Mon Sep 17 00:00:00 2001 From: fisharebest Date: Thu, 16 Dec 2010 08:14:24 +0000 Subject: Fix: function not found in soundex search --- includes/functions/functions_import.php | 1 - includes/functions/functions_lang.php | 48 --------------------------------- includes/functions/functions_name.php | 11 ++++++++ 3 files changed, 11 insertions(+), 49 deletions(-) delete mode 100644 includes/functions/functions_lang.php diff --git a/includes/functions/functions_import.php b/includes/functions/functions_import.php index c68b572d92..52d3433e86 100644 --- a/includes/functions/functions_import.php +++ b/includes/functions/functions_import.php @@ -38,7 +38,6 @@ if (!defined('WT_WEBTREES')) { define('WT_FUNCTIONS_IMPORT_PHP', ''); require_once WT_ROOT.'includes/classes/class_media.php'; -require_once WT_ROOT.'includes/functions/functions_lang.php'; require_once WT_ROOT.'includes/functions/functions_export.php'; // Tidy up a gedcom record on import, so that we can access it consistently/efficiently. diff --git a/includes/functions/functions_lang.php b/includes/functions/functions_lang.php deleted file mode 100644 index 36d67879ca..0000000000 --- a/includes/functions/functions_lang.php +++ /dev/null @@ -1,48 +0,0 @@ - diff --git a/includes/functions/functions_name.php b/includes/functions/functions_name.php index fdaa4235f2..b44d0ed1ae 100644 --- a/includes/functions/functions_name.php +++ b/includes/functions/functions_name.php @@ -33,6 +33,17 @@ if (!defined('WT_WEBTREES')) { define('WT_FUNCTIONS_NAME_PHP', ''); +/** + * Takes a string and converts certain characters in the string to others for the purpose of soundex searches + */ +function Character_Substitute($input) +{ + $stringsToReplace = array("/AE/", "/ae/", "/OE/", "/oe/", "/UE/", "/ue/", "/ss/", "/SS/"); + $replacements = array("Ä", "ä", "Ö", "ö", "Ü", "ü", "ß", "ß"); + + preg_replace($stringsToReplace, $replacements, $input); +} + /** * Get array of common surnames * -- cgit v1.3