- default:
- continue;
- }
-/* if ($aWord['class']) {
- // Special terms need to appear in their normalized form.
- // (postcodes are not normalized in the word table)
- $sNormWord = $this->normalizeString($aWord['word']);
- if ($aWord['word'] && strpos($sNormQuery, $sNormWord) === false) {
- continue;
- }
-
- if ($aWord['class'] == 'place' && $aWord['type'] == 'house') {
- $oToken = new Token\HouseNumber($iId, trim($aWord['word_token']));
- } elseif ($aWord['class'] == 'place' && $aWord['type'] == 'postcode') {
- if ($aWord['word']
- && pg_escape_string($aWord['word']) == $aWord['word']
+ 'P': // postcode tokens
+ // Postcodes are not normalized, so they may have content
+ // that makes SQL injection possible. Reject postcodes
+ // that would need special escaping.
+ if ($aWord['postcode'] === null
+ || pg_escape_string($aWord['postcode']) == $aWord['postcode']