Check, whether client supports compressed data

@return  boolean

@since   11.1
@note    Replaces _clientEncoding method from 11.1
@deprecated  4.0  Use JApplicationWebClient instead
7049
protected static function clientEncoding()
	{
		if (!isset($_SERVER['HTTP_ACCEPT_ENCODING']))
		{
			return false;
		}

		$encoding = false;

		if (false !== strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip'))
		{
			$encoding = 'gzip';
		}

		if (false !== strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'x-gzip'))
		{
			$encoding = 'x-gzip';
		}

		return $encoding;
	}
877548
protected function fix_utf8_flags() {
        if ($this->emptyziphack) {
            return true;
        }

        if (!file_exists($this->archivepathname)) {
            return true;
        }

        // Note: the ZIP structure is described at http://www.pkware.com/documents/casestudies/APPNOTE.TXT
        if (!$fp = fopen($this->archivepathname, 'rb+')) {
            return false;
        }
        if (!$filesize = filesize($this->archivepathname)) {
            return false;
        }

        $centralend = self::zip_get_central_end($fp, $filesize);

        if ($centralend === false or $centralend['disk'] !== 0 or $centralend['disk_start'] !== 0 or $centralend['offset'] === 0xFFFFFFFF) {
            // Single disk archives only and o support for ZIP64, sorry.
            fclose($fp);
            return false;
        }

        fseek($fp, $centralend['offset']);
        $data = fread($fp, $centralend['size']);
        $pos = 0;
        $files = array();
        for($i=0; $i<$centralend['entries']; $i++) {
            $file = self::zip_parse_file_header($data, $centralend, $pos);
            if ($file === false) {
                // Wrong header, sorry.
                fclose($fp);
                return false;
            }

            $newgeneral = $file['general'] | pow(2, 11);
            if ($newgeneral === $file['general']) {
                // Nothing to do with this file.
                continue;
            }

            if (preg_match('/^[a-zA-Z0-9_\-\.]*$/', $file['name'])) {
                // ASCII file names are always ok.
                continue;
            }
            if ($file['extra']) {
                // Most probably not created by php zip ext, better to skip it.
                continue;
            }
            if (fix_utf8($file['name']) !== $file['name']) {
                // Does not look like a valid utf-8 encoded file name, skip it.
                continue;
            }

            // Read local file header.
            fseek($fp, $file['local_offset']);
            $localfile = unpack('Vsig/vversion_req/vgeneral/vmethod/vmtime/vmdate/Vcrc/Vsize_compressed/Vsize/vname_length/vextra_length', fread($fp, 30));
            if ($localfile['sig'] !== 0x04034b50) {
                // Borked file!
                fclose($fp);
                return false;
            }

            $file['local'] = $localfile;
            $files[] = $file;
        }

        foreach ($files as $file) {
            $localfile = $file['local'];
            // Add the unicode flag in central file header.
            fseek($fp, $file['central_offset'] + 8);
            if (ftell($fp) === $file['central_offset'] + 8) {
                $newgeneral = $file['general'] | pow(2, 11);
                fwrite($fp, pack('v', $newgeneral));
            }
            // Modify local file header too.
            fseek($fp, $file['local_offset'] + 6);
            if (ftell($fp) === $file['local_offset'] + 6) {
                $newgeneral = $localfile['general'] | pow(2, 11);
                fwrite($fp, pack('v', $newgeneral));
            }
        }

        fclose($fp);
        return true;
    }
335252
private function saveEncoding()
    {
        if (version_compare(PHP_VERSION, '7.2.0') >= 0) {
            return;
        }

        $iniDirective = 'mbstring' . '.func_overload'; // deprecated in PHP 7.2

        if (ini_get($iniDirective) & 2) {
            $this->encoding = mb_internal_encoding();

            mb_internal_encoding('iso-8859-1');
        }
    }
740871
protected function isUnsupportedServiceJob()
    {
        return $this->serviceJobId === null && $this->serviceNumber === null && $this->serviceEventType === null && $this->repoToken !== null;
    }
263513
public function isSupported()
    {
        $row = $this->getMixer();

        if($row instanceof DatabaseRowInterface)
        {
            if(!$row->hasProperty($this->_parent_column))  {
                return false;
            }
        }

        return true;
    }
875091
public function is_valid() {
        $ret = false;

        if (is_null($this->maxRecipients) === false && is_null($this->priority) === false &&
            is_null($this->compileBeforeDeliveryStart) === false && is_null($this->allowMultipleDeliveries) === false &&
            is_null($this->deliverImmediately) === false && is_null($this->obeyDeliveryLimits) === false
        ) {
            if ($this->deliverImmediately === true || is_null($this->deliveryStartDateTime) === false) {
                if ($this->compileBeforeDeliveryStart === false ||
                    (is_null($this->compileStartDateTime) === false && is_null($this->deliveryStartDateTime) === false &&
                        $this->compileStartDateTime <= $this->deliveryStartDateTime)
                ) {
                    // TODO: deliveryFrequency
                    $ret = true;
                }
            }
        }

        return $ret;
    }
1133765
public function isSupported()
    {
        $result = true;
        $table  = $this->getMixer();

        //Only check if we are connected with a table object, otherwise just return true.
        if($table instanceof DatabaseTableInterface)
        {
            if($table->hasColumn('slug'))
            {
                //If unique is NULL use the column metadata
                if(is_null($this->_unique)) {
                    $this->_unique = $table->getColumn('slug', true)->unique;
                }
            }
            else $result = false;
        }

        return $result;
    }
387729
def _is_compressed(dicom_file, force=False):
    
    header = pydicom.read_file(dicom_file,
                               defer_size="1 KB",
                               stop_before_pixels=True,
                               force=force)

    uncompressed_types = ["1.2.840.10008.1.2",
                          "1.2.840.10008.1.2.1",
                          "1.2.840.10008.1.2.1.99",
                          "1.2.840.10008.1.2.2"]

    if 'TransferSyntaxUID' in header.file_meta and header.file_meta.TransferSyntaxUID in uncompressed_types:
        return False
    return True
240846
public function is_large_prefix_enabled() {
        if ($this->is_antelope_file_format_no_more_supported()) {
            // Breaking change: Antelope file format support has been removed, only Barracuda.
            return true;
        }

        if ($largeprefix = $this->get_record_sql("SHOW VARIABLES LIKE 'innodb_large_prefix'")) {
            if ($largeprefix->value == 'ON') {
                return true;
            }
        }
        return false;
    }
259424
public boolean isSupported() throws NoResponseException, NotConnectedException,
                    InterruptedException, XMPPErrorException {
        // This is just a primitive hack, since XEP-49 does not specify a way to determine if the
        // service supports it
        try {
            setPrivateData(DUMMY_PRIVATE_DATA);
            return true;
        }
        catch (XMPPErrorException e) {
            if (e.getStanzaError().getCondition() == Condition.service_unavailable) {
                return false;
            }
            else {
                throw e;
            }
        }
    }
209257
public function is_supported()
	{
		if ( ! is_dir($this->_cache_path))
		{
			if (!mkdir($this->_cache_path, 0777, false))
			{
				return false;
			}
		}

		return is_really_writable($this->_cache_path);
	}
573830
public function isSupported()
    {
        $mixer   = $this->getMixer();
        $request = $mixer->getRequest();

        if($request->getFormat() == 'html' && $request->isGet() && !$request->isAjax()) {
            return true;
        }

        return false;
    }
527173
public function check()
	{
		if($this->cipher === null)
			return false;
		if($this->compression === 0)
			return false;
		if($this->masterSeed === null)
			return false;
		if($this->transformSeed === null)
			return false;
		if($this->rounds === null)
			return false;
		if($this->encryptionIV === null)
			return false;
		if($this->startBytes === null)
			return false;
		if($this->headerHash === null)
			return false;
		if($this->randomStreamKey === null)
			return false;
		if($this->randomStream === 0)
			return false;
		return true;
	}
32692
public function isSupported()
    {
        $mixer   = $this->getMixer();
        $request = $mixer->getRequest();

        // Support HTML GET requests and also form submits (so we can render errors on POST)
        if(($request->isFormSubmit() || $request->isGet()) && $request->getFormat() == 'html' && !$request->isAjax()) {
            return parent::isSupported();
        }

        return false;
    }
645693
private function verifyExtensionFile()
    {
        $supported_image = array(
            'gif',
            'jpg',
            'jpeg',
            'png'
        );

        $fileName = $_SERVER['HTTP_X_FILE_NAME'];

        $ext = strtolower(pathinfo($fileName, PATHINFO_EXTENSION));
        if (in_array($ext, $supported_image)) {
            return true;
        }
        return false;
    }
1248048
function getEncoding(_zip, _acceptEncoding) {
    if (!_zip) {
      return false
    }
    if (_zip == true) {
      _zip = ENCODING
    }
    if ('string' === typeof _zip) {
      _zip = [_zip]
    }
    if (!Array.isArray(_zip)) {
      return false
    }
    for (let i = 0, length = _acceptEncoding.length; i < length; i++) {
      for (let j = 0; j < _zip.length; j++) {
        if (_zip[j] === _acceptEncoding[i]) {
          return _acceptEncoding[i].toLocaleLowerCase()
        }
      }
    }
  }
1102142
public function isReadable()
    {
        if ($this->stream) {
            $meta = $this->getMetadata();
            $readableModes = ['r', 'r+', 'w+', 'a+', 'x+', 'c+'];
            foreach ($readableModes as $mode) {
                if (strpos($meta['mode'], $mode) === 0) {
                    return true;
                }
            }
        }

        return false;
    }