[TYPO3-core] RFC: fix problems with uname (#3326)

Martin Kutschker Martin.Kutschker at n0spam-blackbox.net
Mon May 15 17:52:22 CEST 2006


Martin Kutschker schrieb:
> Hi!
> 
> Patch request for HEAD and TYPO3_4-0
> 
> Problem:
> 
> php_uname() takes a parameter, which - although not mentioned in the docs) - is not supported in PHP versions earlier than 4.3. There is a report of a misfunction in 4.4.2, which I could not confirm. The effect is the same: instead of the host name, we get the full info string. It's not possible to deduce the host name from this string.
> 
> This affects the sysLog-feature in CLI-mode and HTML-mails.
> 
> Solution:
> 
> Create a unfied function for getting the FQDN of the host name and use it in both occurences.
> This solution has no cure for a broken php_uname but it doesn't produce PHP errors. Using $_SERVER['HTTP_HOST'] should avoid the problem altogether when not in CLI-mode.
> 
> Note:
> 
> The patch also changes the logging from <protocol>://<request-hostame> to <protocol>://<request-hostame>/<site-path> (TYPO3_SITE_URL instead of TYPO3_REQUEST_HOST).

I've attached a new version which adds an additional sanity check for the 
result of gethostbyname() which returns the input as output if no host 
could be found (see PHP docs).

Pleeease, could somebody review it? There are two bug reports and postings 
on the English list.

Masi
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: uname.diff
Url: http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20060515/f832722e/attachment.diff 


More information about the TYPO3-team-core mailing list