Skip to content

Commit

Permalink
Trim string for lookup
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Čihař <[email protected]>
  • Loading branch information
nijel committed Nov 17, 2016
1 parent 2dcf953 commit a5e9c45
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ShapeFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,9 @@ public function setDBFHeader($header) {
*/
public function getIndexFromDBFData($field, $value) {
foreach ($this->records as $index => $record) {
if (isset($record->DBFData[$field]) && (strtoupper($record->DBFData[$field]) == strtoupper($value))) {
if (isset($record->DBFData[$field]) &&
(trim(strtoupper($record->DBFData[$field])) == strtoupper($value))
) {
return $index;
}
}
Expand Down

0 comments on commit a5e9c45

Please sign in to comment.