[TYPO3-core] RFC: #10724: Feature: Provide a check that compare a given URL with the host, TYPO3 is running on!

Marcus Krause marcus#exp2009 at t3sec.info
Thu Apr 2 22:13:22 CEST 2009


Martin Kutschker schrieb am 04/02/2009 01:01 PM Uhr:
> Oliver Hader schrieb:
>> I attached a modified version of your patch that moves the
>> isAllowed-method to t3lib_div since it can be useful for situations that
>> are not only in the backend. Furthermore I changed the comments and some
>> formatting issues.
> 
> -1 if the name stays t3lib_div::isAllowedUrl. The name implies a check
> against a list of valid urls. In fact it only checks if the given
> scheme/host/port (but not the user part) of the current HTTP request is
> the same.
> 
> Maybe t3lib_div::cmpHost($url, $hostlist) is more in line with the
> current code (see t3lib_div::cmpIP).
> 
> Note that I also suggest to use a $hostlist parameter instead of the
> hardcoded self::getIndpEnv('TYPO3_REQUEST_HOST').

How about attached v3?

- cmpHost($url, $list) like suggested
- splitted up unit tests


Marcus.


PS: v3 makes a tiny CGL modification - removing trailing space
This one is for you, Benjamin:
http://www.saltycrane.com/blog/2007/04/how-to-remove-trailing-whitespace-in/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 10724_v3.diff
Type: text/x-diff
Size: 4840 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20090402/0d10b52d/attachment.diff 


More information about the TYPO3-team-core mailing list