public function addExtension($extension)
    {
        $extensions = $this->getExtension();
        if (is_string($extension)) {
            $extension = explode(',', $extension);
        }

        foreach ($extension as $content) {
            if (empty($content) || !is_string($content)) {
                continue;
            }

            $extensions[] = trim($content);
        }
        $extensions = array_unique($extensions);

        // Sanity check to ensure no empty values
        foreach ($extensions as $key => $ext) {
            if (empty($ext)) {
                unset($extensions[$key]);
            }
        }

        $this->_extension = implode(',', $extensions);

        return $this;
    }
public function addExtension($extension)
    {
        $extensions = $this->getExtension();
        if (is_string($extension)) {
            $extension = explode(',', $extension);
        }

        foreach ($extension as $content) {
            if (empty($content) || !is_string($content)) {
                continue;
            }

            $extensions[] = trim($content);
        }
        $extensions = array_unique($extensions);

        // Sanity check to ensure no empty values
        foreach ($extensions as $key => $ext) {
            if (empty($ext)) {
                unset($extensions[$key]);
            }
        }

        $this->_extension = implode(',', $extensions);

        return $this;
    }
public function addExtension ( $ extension ) { $ extensions = $ this -> getExtension ( ) ; if ( is_string ( $ extension ) ) { $ extension = explode ( ',' , $ extension ) ; } foreach ( $ extension as $ content ) { if ( empty ( $ content ) || ! is_string ( $ content ) ) { continue ; } $ extensions [ ] = trim ( $ content ) ; } $ extensions = array_unique ( $ extensions ) ; // Sanity check to ensure no empty values foreach ( $ extensions as $ key => $ ext ) { if ( empty ( $ ext ) ) { unset ( $ extensions [ $ key ] ) ; } } $ this -> _extension = implode ( ',' , $ extensions ) ; return $ this ; }
Adds the file extensions

@param  string|array $extension The extensions to add for validation
@return Zend_Validate_File_Extension Provides a fluent interface
Adds the file extensions