Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update JRegistry::def to support not string defaults.

This updates the behaviour of JRegistry::def so that it doesn't type
cast the default value to a string but leaves it alone consistent
with JRegistry::set's behaviour. This allows you to specify a default
value that utilises an array of an object.
  • Loading branch information...
commit 38dba71b1d25445b70934a648ed2e86690bfd70d 1 parent aed408f
@pasamio pasamio authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 libraries/joomla/registry/registry.php
View
6 libraries/joomla/registry/registry.php
@@ -99,15 +99,15 @@ public function jsonSerialize()
* Sets a default value if not already assigned.
*
* @param string $key The name of the parameter.
- * @param string $default An optional value for the parameter.
+ * @param mixed $default An optional value for the parameter.
*
- * @return string The value set, or the default if the value was not previously set (or null).
+ * @return mixed The value set, or the default if the value was not previously set (or null).
*
* @since 11.1
*/
public function def($key, $default = '')
{
- $value = $this->get($key, (string) $default);
+ $value = $this->get($key, $default);
$this->set($key, $value);
return $value;
}
Please sign in to comment.
Something went wrong with that request. Please try again.