Menu

#12 Incorrect condition to check a locale object

v1.0_(example)
open
nobody
None
5
2006-09-15
2006-09-15
kazaio
No

The methods DispatchAction::dispatchMethod() and
LookupDispatchAction::execute() contain the following
condition:
if(get_class($locale) != 'locale') {...}

This condition works fine if an instance of the Locale-
class of the framework is applied. The application
that I'm developing requires to introduce a class that
is derived from the Locale-class. (For information:
The derived class is complemented by a database-id to
store it in a database.)

The above condition fails if $locale is an instance of
a derived class. The following condition is more
accurate:
if (is_a($locale, 'locale')) {...}

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.