[TYPO3-core] RFC: fix dependency on PHP 4.3 in t3lib_db

Michael Stucki michael at typo3.org
Mon Jan 2 15:22:58 CET 2006


Hi Martin,

>> Problem: While mysql_real_escape_string is the best way to escape DB
>> values it's only available since PHP 4.3 and it needs a valid link
>> identifier.

No, it doesn't need the link identifier. It is optional, and if it is not
specified, PHP will use the last link openend by mysql_connect (see
http://ch.php.net/mysql_real_escape_string).

>> Solution: Test link and fallback to mysql_escape_string.
>> 
>> Note: I'm not sure if we really need the link test as none of the
>> other functions do it. Anyway I think the initialization to FALSE
>> doesn't hurt.

I don't think it is needed, because: If there is really no link, TYPO3 will
fail anyway right after the next DB operation...

The patch is fine but I would like to have the link check removed -
otherwise it should be implemented in _every_ function to have it
consistent.

- michael
-- 
Use a newsreader! Check out
http://typo3.org/community/mailing-lists/use-a-news-reader/



More information about the TYPO3-team-core mailing list