english/libraries/joomla/environment/browser.php
/**
	 * Determines if a browser can display a given MIME type.
	 *
	 * Note that  image/jpeg and image/pjpeg *appear* to be the same
	 * entity, but Mozilla doesn't seem to want to accept the latter.
	 * For our purposes, we will treat them the same.
	 *
	 * @param   string  $mimetype  The MIME type to check.
	 *
	 * @return  boolean  True if the browser can display the MIME type.
	 * @since   11.1
	 */
Determines if a browser can display a given MIME type.
Note that  image/jpeg and image/pjpeg *appear* to be the same
entity, but Mozilla doesn't seem to want to accept the latter.
For our purposes, we will treat them the same.

@param   string  $mimetype  The MIME type to check.

@return  boolean  True if the browser can display the MIME type.
Determines if a browser can display a given MIME type . Note that image / jpeg and image / pjpeg * appear * to be the same entity but Mozilla doesn ' t seem to want to accept the latter . For our purposes we will treat them the same . @param string $mimetype The MIME type to check . @return boolean True if the browser can display the MIME type .
public function isViewable($mimetype)
	{
		$mimetype = strtolower($mimetype);
		list($type, $subtype) = explode('/', $mimetype);
		if (!empty($this->_accept)) {
			$wildcard_match = false;
			if (strpos($this->_accept, $mimetype) !== false) {
				return true;
			}
			if (strpos($this->_accept, '*/*') !== false) {
				$wildcard_match = true;
				if ($type != 'image') {
					return true;
				}
			}
				if ($this->isBrowser('mozilla') &&
				($mimetype == 'image/pjpeg') &&
				(strpos($this->_accept, 'image/jpeg') !== false)) {
					return true;
				}
			if (!$wildcard_match) {
				return false;
			}
		}
		if (!$this->hasFeature('images') || ($type != 'image')) {
			return false;
		}
		return (in_array($subtype, $this->_images));
	}
public function isViewable ( $ mimetype ) { $ mimetype = strtolower ( $ mimetype ) ; list ( $ type , $ subtype ) = explode ( '/' , $ mimetype ) ; if ( ! empty ( $ this -> _accept ) ) { $ wildcard_match = false ; if ( strpos ( $ this -> _accept , $ mimetype ) !== false ) { return true ; } if ( strpos ( $ this -> _accept , '*/*' ) !== false ) { $ wildcard_match = true ; if ( $ type != 'image' ) { return true ; } } if ( $ this -> isBrowser ( 'mozilla' ) && ( $ mimetype == 'image/pjpeg' ) && ( strpos ( $ this -> _accept , 'image/jpeg' ) !== false ) ) { return true ; } if ( ! $ wildcard_match ) { return false ; } } if ( ! $ this -> hasFeature ( 'images' ) || ( $ type != 'image' ) ) { return false ; } return ( in_array ( $ subtype , $ this -> _images ) ) ; }
Determines if a browser can display a given MIME type.
Determines if a browser can display a given MIME type .
// Deal with Mozilla pjpeg/jpeg issue