[TYPO3-core] FYI24: #8826: calls to ini_set produces warnings
Francois Suter
fsuter at cobweb.ch
Wed Sep 3 13:23:43 CEST 2008
Hi,
>> if(!file_exists($file)) {
>> throw new FileNotFoundException();
>> }
>>
>> No need for an @
>
> And you will see a PHP warning with your when file does not exist. It is
> a known behaviour of file_exists(): if file does not exists, you will
> see a warning that file does not exist. No way to prevent it without @.
Yes. And this is not just a problem of revealing information or not. I
recently implement a tool where an Alfresco server could send files to
the TYPO3 BE to be archived by the DAM. The BE remote call server sent
back a response object (just like the BE AJAX script does). When you get
such a warning, it breaks the layout of the response and causes error in
the client.
So it is important to suppress unwanted PHP warnings and we must accept
the shortcomings of PHP in such cases. So I'm all for the use of @ when
there's no other solution.
Cheers
--
Francois Suter
Cobweb Development Sarl - http://www.cobweb.ch
More information about the TYPO3-team-core
mailing list