I was coding along, and I reversed the order of the args in my page to the property_exists() function. After I fixed my error, I searched for any other instances where I'd done that. The editor found this code in libraries/cms/application/administrator.php at line 421:
if (property_exists('JConfig', 'root_user')
&& (JFactory::getUser()->get('username') == $rootUser || JFactory::getUser()->id === (string) $rootUser))
{
$this->enqueueMessage(
JText::sprintf(
'JWARNING_REMOVE_ROOT_USER',
'index.php?option=com_config&task=config.removeroot&' . JSession::getFormToken() . '=1'
),
'notice'
);
}
I didn't really dig into what it's supposed to be doing, but it's definitely not correct.
My mistake. I didn't see that it takes a class name. I assumed it was an instance.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-04-04 20:28:53 |
Closed_By | ⇒ | gsexton |
No problem. There are more than enough quirks in PHP to make you second guess yourself, I do it every day
Labels |
Added:
?
|
How's it not correct? property_exists() lets you check if a property is defined on a class name (string parameter) or an object, so that use is just fine.