BMLT Root Server
Classes | Functions
comdef_utilityclasses.inc.php File Reference

Some basic utility classes and functions to be used throughout the CoMDEF system. More...

Go to the source code of this file.

Classes

class  bdfProfiler
 Execution time/memory profiling class. More...
 

Functions

 GetURLToMainServerDirectory ($inAllowHTTPS=true)
 Returns a URL (HTTP) to the main_server directory (or renamed). More...
 
 SplitIntoMetaphone ($in_string, $in_lang_enum=null, $in_literal=false)
 Converts a string into an array of metaphone entities. More...
 
 FullCrypt ($in_string, $in_salt=null, &$crypt_method=null)
 Encrypts a string, using the most effective encryption. More...
 
 json_prepare ($data, $escapeSpecialChars=false)
 This function accepts an array of data (or a single element), and "cleans it up" in preparation for use as a JSON string. More...
 
 call_curl ($in_uri, $in_post=true, &$http_status=null)
 This is a function that returns the results of an HTTP call to a URI. It is a lot more secure than file_get_contents, but does the same thing. More...
 
 c_comdef_admin_bar ($in_http_vars)
 Returns the HTML for an "Admin Bar" along the top of the page. More...
 
 c_comdef_htmlspecialchars ($in_string)
 This function creates a displayable string. More...
 
 c_comdef_vet_email_address ($in_address)
 This function vets the email address for proper form. More...
 
 c_comdef_LogoutUser ()
 This function can be called to terminate the session. More...
 

Detailed Description

Some basic utility classes and functions to be used throughout the CoMDEF system.

These classes and functions describe some basic functionality that is used throughout the system.

Definition in file comdef_utilityclasses.inc.php.

Function Documentation

c_comdef_admin_bar (   $in_http_vars)

Returns the HTML for an "Admin Bar" along the top of the page.

Returns
the HTML for the bar.
Parameters
$in_http_varsThe aggregation of the $_GET and $_POST superglobals, as an associative array.

Definition at line 288 of file comdef_utilityclasses.inc.php.

References $http_vars, $lang_enum, $ret, $server, _USER_LEVEL_DISABLED, _USER_LEVEL_OBSERVER, c_comdef_htmlspecialchars(), c_comdef_server\GetLocalStrings(), and c_comdef_server\MakeServer().

290 {
291  $x_file = $_SERVER ['SCRIPT_NAME'];
292  require_once(dirname(__FILE__).'/../../../server/c_comdef_server.class.php');
293  $ret = '';
295  if ($server instanceof c_comdef_server) {
296  $localized_strings = c_comdef_server::GetLocalStrings();
297  include(dirname(__FILE__).'/../../../server/config/get-config.php');
298 
299  $user_obj = $server->GetCurrentUserObj();
300  if (($user_obj instanceof c_comdef_user) && ($user_obj->GetUserLevel() != _USER_LEVEL_DISABLED) && ($user_obj->GetUserLevel() != _USER_LEVEL_OBSERVER)) {
301  $left_link = ' ';
302  $middle_link = ' ';
303 
304  if (isset($in_http_vars['edit_cp'])
305  || (isset($in_http_vars['do_search']) && $in_http_vars['do_search'])
306  || (isset($in_http_vars['single_meeting_id']) && $in_http_vars['single_meeting_id']) ) {
307  $left_link = '<a href="'.$x_file.'?supports_ajax=yes&amp;lang_enum='.htmlspecialchars($lang_enum).'">';
308  $left_link .= c_comdef_htmlspecialchars($localized_strings['comdef_search_admin_strings']['Admin_Bar']['meeting_search']);
309  $left_link .= '</a>';
310  }
311 
312  if (!isset($in_http_vars['edit_cp'])) {
313  $link = '<a href="'.$x_file.'?edit_cp&amp;supports_ajax=yes&amp;lang_enum='.htmlspecialchars($lang_enum).'">';
314  $link .= c_comdef_htmlspecialchars($localized_strings['comdef_search_admin_strings']['Admin_Bar']['edit_link']);
315  $link .= '</a>';
316  if ($left_link == '&nbsp;') {
317  $left_link = $link;
318  } else {
319  $middle_link = $link;
320  }
321  }
322 
323  $right_link = '<a href="'.$x_file.'?logout&amp;supports_ajax=yes&amp;lang_enum='.htmlspecialchars($lang_enum).'">';
324  $right_link .= c_comdef_htmlspecialchars($localized_strings['comdef_search_admin_strings']['Admin_Bar']['logout']);
325  $right_link .= '</a>';
326 
327  $info_string = '<div class="bmlt_admin_info_div">';
328  $info_string .= c_comdef_htmlspecialchars($localized_strings['comdef_search_admin_strings']['Admin_Bar']['logged_in']);
329  $info_string .= c_comdef_htmlspecialchars($localized_strings['comdef_search_admin_strings']['Edit_Users'][$user_obj->GetUserLevel()]);
330  $info_string .= c_comdef_htmlspecialchars($localized_strings['comdef_search_admin_strings']['Admin_Bar']['login_name']);
331  $info_string .= c_comdef_htmlspecialchars($user_obj->GetLogin());
332  $info_string .= '</div>';
333 
334  $admin_links = '<div class="bmlt_admin_links_div">';
335  $admin_links .= '<div class="bmlt_admin_one_link_div">'.$left_link.'</div>';
336  $admin_links .= '<div class="bmlt_admin_one_link_div">'.$middle_link.'</div>';
337  $admin_links .= '<div class="bmlt_admin_one_link_div">'.$right_link.'</div>';
338  $admin_links .= '</div>';
339  } elseif (($user_obj instanceof c_comdef_user) && ($user_obj->GetUserLevel() == _USER_LEVEL_OBSERVER)) {
340  $info_string = '<div class="bmlt_admin_info_div">';
341  $info_string .= c_comdef_htmlspecialchars($localized_strings['comdef_search_admin_strings']['Admin_Bar']['logged_in']);
342  $info_string .= c_comdef_htmlspecialchars($localized_strings['comdef_search_admin_strings']['Edit_Users'][$user_obj->GetUserLevel()]);
343  $info_string .= c_comdef_htmlspecialchars($localized_strings['comdef_search_admin_strings']['Admin_Bar']['login_name']);
344  $info_string .= c_comdef_htmlspecialchars($user_obj->GetLogin());
345  $info_string .= '</div>';
346 
347  $admin_links = '<div class="bmlt_admin_links_div">';
348  if (isset($in_http_vars['edit_cp'])
349  || (isset($in_http_vars['do_search']) && $in_http_vars['do_search'])
350  || (isset($in_http_vars['single_meeting_id']) && $in_http_vars['single_meeting_id']) ) {
351  $admin_links .= '<div class="bmlt_admin_one_link_div">';
352  $admin_links .= '<a href="'.$x_file.'?supports_ajax=yes&amp;lang_enum='.htmlspecialchars($lang_enum).'">';
353  $admin_links .= c_comdef_htmlspecialchars($localized_strings['comdef_search_admin_strings']['Admin_Bar']['meeting_search']);
354  $admin_links .= '</a>';
355  $admin_links .= '</div>';
356  $admin_links .= '<div class="bmlt_admin_one_link_div">&nbsp;</div>';
357  $admin_links .= '<div class="bmlt_admin_one_link_div">';
358  $admin_links .= '<a href="'.$x_file.'?logout&amp;supports_ajax=yes&amp;lang_enum='.htmlspecialchars($lang_enum).'">';
359  $admin_links .= c_comdef_htmlspecialchars($localized_strings['comdef_search_admin_strings']['Admin_Bar']['logout']);
360  $admin_links .= '</a>';
361  $admin_links .= '</div>';
362  } else {
363  $admin_links .= '<div class="bmlt_admin_one_link_div">&nbsp;</div>';
364  $admin_links .= '<div class="bmlt_admin_one_link_div">';
365  $admin_links .= '<a href="'.$x_file.'?logout&amp;supports_ajax=yes&amp;lang_enum='.htmlspecialchars($lang_enum).'">';
366  $admin_links .= c_comdef_htmlspecialchars($localized_strings['comdef_search_admin_strings']['Admin_Bar']['logout']);
367  $admin_links .= '</a>';
368  $admin_links .= '</div>';
369  $admin_links .= '<div class="bmlt_admin_one_link_div">&nbsp;</div>';
370  }
371 
372  $admin_links .= '</div>';
373  } else {
374  $info_string = '<div class="bmlt_admin_info_div">&nbsp;</div>';
375  $admin_links = '<div class="bmlt_admin_links_div">';
376  $admin_links .= '<div class="bmlt_admin_one_link_div">&nbsp;</div>';
377  $admin_links .= '<div class="bmlt_admin_one_link_div"><a class="login_div" href="'.$_SERVER['SCRIPT_NAME'].'?login&amp;supports_ajax=yes&amp;lang_enum='.htmlspecialchars($lang_enum).'">'.c_comdef_htmlspecialchars($localized_strings['comdef_search_admin_strings']['Admin_Bar']['login']).'</a></div>';
378  $admin_links .= '<div class="bmlt_admin_one_link_div">&nbsp;</div>';
379  $admin_links .= '</div>';
380  }
381 
382  if (!isset($http_vars['login']) && !isset($_POST['login'])) {
383  $ret = '<div class="bmlt_admin_strip no_print" id ="bmlt_admin_strip">'.$info_string.$admin_links.'<div class="clear_both"></div></div>';
384  }
385  }
386 
387  return $ret;
388 }
static GetLocalStrings($in_lang_enum=null)
This gets the appropriate language files, and puts all the the strings into an associative array...
This class handles BMLT users. One instance is created for each user on the server.
$ret
Definition: contact.php:226
const _USER_LEVEL_OBSERVER
const _USER_LEVEL_DISABLED
$lang_enum
Definition: index.php:23
global $http_vars
Definition: index.php:21
c_comdef_htmlspecialchars($in_string)
This function creates a displayable string.
static MakeServer()
This is the factory for the server instantiation. It makes sure that only one instance exists...
This class is the main server class. It instantiates a PDO database object, and is the starting point...
c_comdef_htmlspecialchars (   $in_string)

This function creates a displayable string.

Returns
The "cleaned" string

Definition at line 395 of file comdef_utilityclasses.inc.php.

References $ret, and c_comdef_server\GetLocalStrings().

Referenced by BuildFormats(), BuildLocation(), BuildTime(), BuildTown(), c_comdef_admin_bar(), c_comdef_LoginForm(), c_comdef_change\DetailedChangeDescription(), json_prepare(), parse_redirect(), prepareSimpleLine(), c_comdef_admin_xml_handler\process_capabilities_request(), c_comdef_admin_xml_handler\process_meeting_delete(), c_comdef_admin_xml_handler\process_service_body_info_request(), and c_comdef_admin_xml_handler\process_user_info().

396 {
397  $local_strings = c_comdef_server::GetLocalStrings();
398  $ret = htmlspecialchars($in_string, null, $local_strings['charset']);
399 
400  return $ret;
401 }
static GetLocalStrings($in_lang_enum=null)
This gets the appropriate language files, and puts all the the strings into an associative array...
$ret
Definition: contact.php:226
c_comdef_LogoutUser ( )

This function can be called to terminate the session.

Definition at line 421 of file comdef_utilityclasses.inc.php.

422 {
423  if (!isset($_SESSION)) {
424  session_start();
425  }
426 
427  // Wipe out the session variables
428  $_SESSION = array();
429 
430  // Eat the session cookie.
431  if (isset($_COOKIE[session_name()])) {
432  setcookie(session_name(), '', time() - 42000, '/');
433  }
434 
435  // Bye, now...
436  session_write_close(); // Close the session.
437 }
c_comdef_vet_email_address (   $in_address)

This function vets the email address for proper form.

Returns
true if the email address has a valid format.

Definition at line 408 of file comdef_utilityclasses.inc.php.

References $ret.

Referenced by c_comdef_admin_ajax_handler\SetMeetingDataValues().

409 {
410  $ret = false;
411  if (isset($in_address) && is_string($in_address) && trim($in_address) && preg_match('#^(?:[a-zA-Z0-9_\'^&amp;/+-])+(?:\.(?:[a-zA-Z0-9_\'^&amp;/+-])+)*@(?:(?:\[?(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))\.){3}(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\]?)|(?:[a-zA-Z0-9-]+\.)+(?:[a-zA-Z]){2,}\.?)$#', $in_address)) {
412  $ret = true;
413  }
414 
415  return $ret;
416 }
$ret
Definition: contact.php:226
call_curl (   $in_uri,
  $in_post = true,
$http_status = null 
)

This is a function that returns the results of an HTTP call to a URI. It is a lot more secure than file_get_contents, but does the same thing.

Returns
a string, containing the response. Null if the call fails to get any data.
Exceptions
anexception if the call fails.
Parameters
$in_uriA string. The URI to call.
$in_postIf false, the transaction is a GET, not a POST. Default is true.
$http_statusOptional reference to a string. Returns the HTTP call status.

Definition at line 179 of file comdef_utilityclasses.inc.php.

References $ret.

Referenced by bmlt_semantic\ajax_handler(), bmlt_semantic\get_server_keys(), bmlt_semantic\get_server_langs(), and bmlt_semantic\get_server_version().

183  {
184  $ret = null;
185 
186  // If the curl extension isn't loaded, we try one backdoor thing. Maybe we can use file_get_contents.
187  if (!extension_loaded('curl')) {
188  if (ini_get('allow_url_fopen')) {
189  $ret = file_get_contents($in_uri);
190  }
191  } else {
192  // This gets the session as a cookie.
193  if (isset($_COOKIE['PHPSESSID']) && $_COOKIE['PHPSESSID']) {
194  $strCookie = 'PHPSESSID=' . $_COOKIE['PHPSESSID'] . '; path=/';
195 
196  session_write_close();
197  }
198 
199  // Create a new cURL resource.
200  $resource = curl_init();
201 
202  if (isset($strCookie)) {
203  curl_setopt($resource, CURLOPT_COOKIE, $strCookie);
204  }
205 
206  // If we will be POSTing this transaction, we split up the URI.
207  if ($in_post) {
208  $spli = explode("?", $in_uri, 2);
209 
210  if (is_array($spli) && count($spli)) {
211  $in_uri = $spli[0];
212  $in_params = $spli[1];
213  // Convert query string into an array using parse_str(). parse_str() will decode values along the way.
214  parse_str($in_params, $temp);
215 
216  // Now rebuild the query string using http_build_query(). It will re-encode values along the way.
217  // It will also take original query string params that have no value and appends a "=" to them
218  // thus giving them and empty value.
219  $in_params = http_build_query($temp);
220 
221  curl_setopt($resource, CURLOPT_POST, true);
222  curl_setopt($resource, CURLOPT_POSTFIELDS, $in_params);
223  }
224  }
225 
226  // Set url to call.
227  curl_setopt($resource, CURLOPT_URL, $in_uri);
228 
229  // Make curl_exec() function (see below) return requested content as a string (unless call fails).
230  curl_setopt($resource, CURLOPT_RETURNTRANSFER, true);
231 
232  // By default, cURL prepends response headers to string returned from call to curl_exec().
233  // You can control this with the below setting.
234  // Setting it to false will remove headers from beginning of string.
235  // If you WANT the headers, see the Yahoo documentation on how to parse with them from the string.
236  curl_setopt($resource, CURLOPT_HEADER, false);
237 
238  // Allow cURL to follow any 'location:' headers (redirection) sent by server (if needed set to true, else false- defaults to false anyway).
239  // Disabled, because some servers disable this for security reasons.
240 // curl_setopt ( $resource, CURLOPT_FOLLOWLOCATION, true );
241 
242  // Set maximum times to allow redirection (use only if needed as per above setting. 3 is sort of arbitrary here).
243  curl_setopt($resource, CURLOPT_MAXREDIRS, 3);
244 
245  // Set connection timeout in seconds (very good idea).
246  curl_setopt($resource, CURLOPT_CONNECTTIMEOUT, 10);
247 
248  // Direct cURL to send request header to server allowing compressed content to be returned and decompressed automatically (use only if needed).
249  curl_setopt($resource, CURLOPT_ENCODING, 'gzip,deflate');
250 
251  // Pretend we're a browser, so that anti-cURL settings don't pooch us.
252  curl_setopt($resource, CURLOPT_USERAGENT, "cURL Mozilla/5.0 (Windows NT 5.1; rv:21.0) Gecko/20130401 Firefox/21.0");
253 
254  // Trust meeeee...
255  curl_setopt($resource, CURLOPT_SSL_VERIFYPEER, false);
256 
257  // Execute cURL call and return results in $content variable.
258  $content = curl_exec($resource);
259 
260  // Check if curl_exec() call failed (returns false on failure) and handle failure.
261  if ($content === false) {
262  // Cram as much info into the exception as possible.
263  throw new Exception("curl failure calling $in_uri, ".curl_error($resource).", ".curl_errno($resource));
264  } else {
265  // Do what you want with returned content (e.g. HTML, XML, etc) here or AFTER curl_close() call below as it is stored in the $content variable.
266 
267  // You MIGHT want to get the HTTP status code returned by server (e.g. 200, 400, 500).
268  // If that is the case then this is how to do it.
269  $http_status = curl_getinfo($resource, CURLINFO_HTTP_CODE);
270  }
271 
272  // Close cURL and free resource.
273  curl_close($resource);
274 
275  // Maybe echo $contents of $content variable here.
276  if ($content !== false) {
277  $ret = $content;
278  }
279  }
280 
281  return $ret;
282 }
$ret
Definition: contact.php:226
FullCrypt (   $in_string,
  $in_salt = null,
$crypt_method = null 
)

Encrypts a string, using the most effective encryption.

This function will encrypt a string, using the standard PHP crypt() function, and, if asked, will use the most secure algorithm available on the server. This is a one-way encryption.

NOTE: If you use this in "secure" mode (other than CRYPT_DES), it may deliver passwords in a format that cannot be ported to other servers.

UPDATE** This now uses the PHP password_hash() function. Much better. This also means that you need to check with hash_equals() and password_verify().

Returns
a string, which is the given string, encrypted. Use this to compare with other strings, or as a salt for future encryptions.
Parameters
$in_stringThe string to be encrypted
$in_saltIGNORED
$crypt_methodIGNORED

Definition at line 128 of file comdef_utilityclasses.inc.php.

Referenced by c_comdef_server\AddNewUser(), dropEverything(), and c_comdef_user\SetNewPassword().

132  {
133  return password_hash($in_string, PASSWORD_DEFAULT);
134 }
GetURLToMainServerDirectory (   $inAllowHTTPS = true)

Returns a URL (HTTP) to the main_server directory (or renamed).

Returns
an HTTP URL, with the port (if necessary) and HTTPS (If necessary).
Parameters
$inAllowHTTPSIf TRUE (default), then the URI will be allowed to use HTTPS. If FALSE, then we explicitly disallow HTTPS.

Definition at line 20 of file comdef_utilityclasses.inc.php.

References $https, and $url_path.

Referenced by c_comdef_admin_main_console\__construct(), DisplaySearchResultsCSV(), GetFormats(), and c_comdef_admin_xml_handler\getMainURL().

22  {
23  global $g_do_not_force_port;
24 
25  $from_proxy = array_key_exists("HTTP_X_FORWARDED_PROTO", $_SERVER);
26  if ($from_proxy) {
27  $https = $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https';
28  if (array_key_exists("HTTP_X_FORWARDED_PORT", $_SERVER)) {
29  $port = intval($_SERVER['HTTP_X_FORWARDED_PORT']);
30  } elseif ($https) {
31  $port = 443;
32  } else {
33  $port = 80;
34  }
35  } else {
36  $port = intval($_SERVER['SERVER_PORT']);
37  $https = $inAllowHTTPS && (!empty($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] !== 'off' || $port == 443)) ? true : false;
38  }
39 
40  $url_path = $_SERVER['SERVER_NAME'];
41  $file_path = str_replace('\\', '/', dirname(dirname(dirname(dirname(dirname(__FILE__))))));
42  $my_path = str_replace('\\', '/', dirname($_SERVER['PHP_SELF']));
43  $subsequent_path = str_replace($file_path, '', $my_path);
44 
45  // See if we need to add an explicit port to the URI.
46  if (!isset($g_do_not_force_port) || !$g_do_not_force_port) {
47  if (!$https && ($port != 80)) {
48  $url_path .= ":$port";
49  } elseif ($https && ($port != 443)) {
50  $url_path .= ":$port";
51  }
52  }
53 
54  $url_path .= '/'.trim($subsequent_path, '/').'/';
55  $url_path = 'http'.($https ? 's' : '').'://'.$url_path;
56  return $url_path;
57 }
if(file_exists($config_file_path)) $url_path
Definition: index.php:64
$https
Definition: installer.php:72
json_prepare (   $data,
  $escapeSpecialChars = false 
)

This function accepts an array of data (or a single element), and "cleans it up" in preparation for use as a JSON string.

Returns
a string, containing the "cleaned" array

Definition at line 142 of file comdef_utilityclasses.inc.php.

References c_comdef_htmlspecialchars().

Referenced by c_comdef_admin_ajax_handler\GetMeetingHistory(), c_comdef_admin_ajax_handler\HandleDeleteServiceBody(), c_comdef_admin_ajax_handler\HandleDeleteUser(), c_comdef_admin_ajax_handler\HandleFormatChange(), c_comdef_admin_ajax_handler\HandleServiceBodyChange(), c_comdef_admin_ajax_handler\HandleServiceBodyCreate(), c_comdef_admin_ajax_handler\HandleUserChange(), c_comdef_admin_ajax_handler\HandleUserCreate(), and c_comdef_admin_ajax_handler\SetMeetingDataValues().

143 {
144  if (is_object($data)) {
145  throw new Exception(__FUNCTION__ . '() objects are not supported by this function');
146  }
147 
148  if (is_array($data)) {
149  $temp = array();
150 
151  reset($data);
152  foreach ($data as $key => $value) {
153  $temp[json_prepare($key, $escapeSpecialChars)] = json_prepare($value, $escapeSpecialChars);
154  }
155 
156  $data = $temp;
157  } else {
158  if (!is_null($data)) {
159  $data = preg_replace("|\"|", "\\\"", $data);
160  if ($escapeSpecialChars) {
161  $data = utf8_encode(c_comdef_htmlspecialchars($data, ENT_QUOTES));
162  } else {
163  $data = utf8_encode($data);
164  }
165  }
166  }
167 
168  return $data;
169 }
c_comdef_htmlspecialchars($in_string)
This function creates a displayable string.
json_prepare($data, $escapeSpecialChars=false)
This function accepts an array of data (or a single element), and "cleans it up" in preparation for u...
SplitIntoMetaphone (   $in_string,
  $in_lang_enum = null,
  $in_literal = false 
)

Converts a string into an array of metaphone entities.

This breaks up the given string into metaphone keys, and returns them in an array, so they can be easily compared.

http://us2.php.net/manual/en/function.metaphone.php

Returns
An associative array of metaphone keys. Null if none given. The value will be the metaphone key, and the key will be the original string, converted to lowercase.

If no language is given, we use the server's native language.

We also have a Spanish version of metaphone() available.

Parameters
$in_stringThe string to split up.
$in_lang_enumThis is the code for the desired language. If not given, the server localization will be used.
$in_literalIf this is set to true (default is false), then metaphone will not be used.

Definition at line 71 of file comdef_utilityclasses.inc.php.

References $ret, c_comdef_server\GetServer(), and spanish_metaphone().

Referenced by c_comdef_formats\GetFormatsByString(), c_comdef_meetings\GetMeetingsByKeyValue(), and c_comdef_meetings\GetMeetingsByString().

75  {
76  $ret = null;
77 
78  $in_string = mb_strtolower(trim($in_string), 'UTF-8');
79 
80  /// If no language is given, we use the server's native language.
81  if (null == $in_lang_enum) {
82  $in_lang_enum = c_comdef_server::GetServer()->GetLocalLang();
83  }
84 
85  if (("en" == $in_lang_enum) || ("es" == $in_lang_enum)) {
86  $ar = explode(" ", $in_string);
87 
88  if (is_array($ar) && count($ar)) {
89  foreach ($ar as &$string) {
90  $string = mb_strtolower(trim($string), 'UTF-8');
91 
92  if ($string) {
93  $mp = $string;
94 
95  if (!$in_literal && ("en" == $in_lang_enum)) {
96  $mp = metaphone($mp);
97  } elseif (!$in_literal && ("es" == $in_lang_enum)) {
98  /// We also have a Spanish version of metaphone() available.
99  $mp = spanish_metaphone($mp);
100  }
101 
102  $ret[] = $mp;
103  }
104  }
105  }
106  } else {
107  $ret = array ( $in_string );
108  }
109 
110  return $ret;
111 }
spanish_metaphone($string)
This is a Spanish version of the standard double metaphone tokenizer.
$ret
Definition: contact.php:226