Issues

ZF-7443: value $option erased by foreach loop

Issue Type: Bug Created: 2009-08-02T01:49:39.000+0000 Last Updated: 2009-08-02T07:02:56.000+0000 Status: Resolved Fix version(s): - 1.9.0 (31/Jul/09)

Reporter: Marek (deuter) Assignee: Thomas Weidner (thomas) Tags: - Zend_Translate

Related issues: - ZF-7099

Attachments:

Description

abstract class Zend_Translate_Adapter { ... public function setOptions(array $options = array()) { $change = false; $locale = null; foreach ($options as $key => $option) { if ($key == 'locale') { $locale = $option; } else if ((isset($this->_options[$key]) and ($this->_options[$key] != $option)) or !isset($this->_options[$key])) { if (($key == 'log') && !($option instanceof Zend_Log)) { require_once 'Zend/Translate/Exception.php'; throw new Zend_Translate_Exception('Instance of Zend_Log expected for option log'); }

            $this->_options[$key] = $option;
            $change = true;
        }
    }

    if ($locale !== null) {
        $this->setLocale($option);                                     <------------!!!------------  should be:   $this->setLocale($locale);
    }

    if (isset(self::$_cache) and ($change == true)) {
        $id = 'Zend_Translate_' . $this->toString() . '_Options';
        self::$_cache->save( serialize($this->_options), $id);
    }

    return $this;
}

... }

Comments

Posted by Thomas Weidner (thomas) on 2009-08-02T02:38:39.000+0000

Duplicate of already solved issue ZF-7099

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts