Changeset 2997

Show
Ignore:
Timestamp:
07/08/2008 04:29:13 AM (5 months ago)
Author:
Geert
Message:

Yes, those parentheses do make a difference because alternation is constrained by them. Without them you would be matching extensions that, for example, contain "png" or "gif" *anywhere*. Not good.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/helpers/file.php

    r2996 r2997  
    4242                $extension = pathinfo($filename, PATHINFO_EXTENSION); 
    4343 
    44                 if (preg_match('/^jpe?g|png|[gt]if|bmp|swf$/', $extension)) 
     44                if (preg_match('/^(?:jpe?g|png|[gt]if|bmp|swf)$/', $extension)) 
    4545                { 
    4646                        // Disable error reporting