Task #33097

Usage of preg_match allows side-effects

Added by Adrian Föder over 3 years ago. Updated over 3 years ago.

Status:Resolved Start date:2012-01-10
Priority:Should have Due date:
Assigned To:Adrian Föder % Done:

100%

Category:I18n
Target version:TYPO3 Flow Base Distribution - 1.1
Sprint: Has patch:Yes
PHP Version: Complexity:easy

Description

as of http://php.net/function.preg-match the function could also return FALSE if an error occurs (see Return Values and Changelog sections). At some places there is, e.g.,

if (preg_match(self::PATTERN_MATCH_LOCALEIDENTIFIER, $localeIdentifier, $matches) === 0) throw new....

used. This would let a return of FALSE pass by untouched.

Associated revisions

Revision b03e9eae
Added by Adrian Föder over 3 years ago

[TASK] Regard return type of preg_match

As of PHP-documentation, preg_match() may return int 0 or 1
or boolean FALSE. This patch takes care of this behaviour.

Change-Id: I68537730e97934ea8dab1a9e83bb402a26d4912a
Resolves: #33097
Releases: 1.1

History

#1 Updated by Gerrit Code Review over 3 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7723

#2 Updated by Karsten Dambekalns over 3 years ago

  • Target version set to 1.1

#3 Updated by Gerrit Code Review over 3 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7723

#4 Updated by Adrian Föder over 3 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF