Skip to content

Commit a5e9c45

Browse files
committed
Trim string for lookup
Signed-off-by: Michal Čihař <[email protected]>
1 parent 2dcf953 commit a5e9c45

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ShapeFile.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,9 @@ public function setDBFHeader($header) {
227227
*/
228228
public function getIndexFromDBFData($field, $value) {
229229
foreach ($this->records as $index => $record) {
230-
if (isset($record->DBFData[$field]) && (strtoupper($record->DBFData[$field]) == strtoupper($value))) {
230+
if (isset($record->DBFData[$field]) &&
231+
(trim(strtoupper($record->DBFData[$field])) == strtoupper($value))
232+
) {
231233
return $index;
232234
}
233235
}

0 commit comments

Comments
 (0)