Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shanikawm committed Jun 25, 2015
1 parent 218be61 commit 8dde6b1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Dyms/dyms.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* User: Shanika
* Author: Shanika Amarasoma
* Date: 6/23/2015
* Time: 2:10 PM
*/
Expand Down Expand Up @@ -32,7 +32,11 @@ public function search($needle, $limit = 5)
if (count($h_split) > 1) {
foreach ($h_split as $hs) {
similar_text(strtolower($hs), $needle, $p);
$similar[$h] = max($p, $similar[$h]);
if (isset($similar[$h])) {
$similar[$h] = max($p, $similar[$h]);
} else {
$similar[$h] = $p;
}
}
} else {
similar_text(strtolower($h), $needle, $p);
Expand Down

0 comments on commit 8dde6b1

Please sign in to comment.