Notifications can now look for partial names.

pull/136/head
Joe Prochazka 2016-04-01 16:22:08 -04:00
rodzic bc18b44c33
commit a7efcf3c93
1 zmienionych plików z 12 dodań i 2 usunięć

Wyświetl plik

@ -81,11 +81,21 @@
$foundFlights = array();
foreach ($lookingFor as $flight) {
if (in_array($flight[0], $visibleFlights)) {
$foundFlights[] = $flight[0];
if(strpos($flight[0], "%") !== false) {
$searchFor = str_replace("%", "", $flight[0]);
foreach ($visibleFlights as $visible) {
if (strpos(strtolower($visible), strtolower($searchFor)) !== false) {
$foundFlights[] = $visible;
}
}
} else {
if (in_array($flight[0], $visibleFlights)) {
$foundFlights[] = $flight[0];
}
}
}
return json_decode(json_encode((array)$foundFlights), true);
}
?>