Development

#3472 ("return false" lake in i18n/sfMessageSource.class/php)

You must first sign up to be able to contribute.

Ticket #3472 (closed defect: fixed)

Opened 7 months ago

Last modified 7 months ago

"return false" lake in i18n/sfMessageSource.class/php

Reported by: konandrum Assigned to: fabien
Priority: minor Milestone:
Component: i18n Version: 1.0.13
Keywords: Cc:
Qualification: Unreviewed

Description

In the file sfMessageSource.class.php (in the directory i18n) there is not a return false call in the function

function load($catalogue = 'messages')

from the line 166 to 169:

if ($this->isValidSource($source) == false)
{
     continue;
}

I think have to be:

if ($this->isValidSource($source) == false)
{
   return false;
}

may be there is a reason of this ?

Change History

05/04/08 23:16:14 changed by FabianLange

because if this source is not valid,perhaps the next one is? return would terminate the for-each-loop.

But however you are right. the doc says that it can return false, but it never will

perhaps a line 202:

return count($this->messages) != 0;

would be the appropriate way

05/05/08 09:23:29 changed by fabien

  • milestone set to 1.0.14.

05/05/08 09:26:01 changed by fabien

  • status changed from new to closed.
  • resolution set to fixed.

(In [8778]) fixed sfMessageSource::load() to return false if no catalogue is loaded (closes #3472)

05/05/08 10:30:57 changed by fabien

(In [8783]) fixed sfMessageSource::load() to return false if no catalogue is loaded (closes #3472)

05/05/08 10:46:18 changed by fabien

  • milestone deleted.

reverted as sfMessageSource relies on the fact that ->load() always returns true. I've updated the API doc.