Retrieves internalSubset even in bugfixed php versions.

@param string $data

@return string
168324
private function getDomDocumentType(string $data): string
    {
        $startPos = $endPos = \stripos($data, '<!doctype');
        $braces = 0;
        do {
            $char = $data[$endPos++];
            if ('<' === $char) {
                ++$braces;
            }
            if ('>' === $char) {
                --$braces;
            }
        } while ($braces > 0);

        $internalSubset = \substr($data, $startPos, $endPos - $startPos);
        $internalSubset = \str_replace(["\n", "\r"], '', $internalSubset);
        $internalSubset = \preg_replace('/\s{2,}/', ' ', $internalSubset);
        $internalSubset = \str_replace(['[ <!', '> ]>'], ['[<!', '>]>'], $internalSubset);

        return $internalSubset;
    }
91384
function stripHTTPHeader( $data )
    {
        $start = strpos( $data, "<?xml version=\"1.0\"?>" );
        return substr( $data, $start, strlen( $data ) - $start );
    }
344728
protected function retrieveData($data)
    {
        $filter = $this->getInputFilter();

        if (null !== $filter) {
            return $filter->getValues();
        }

        return (array)$data;
    }
211508
final public static function unpack(string $data): self
    {
        $self = new static();
        [
            $self->version,
            $self->type,
            $self->requestId,
            $self->contentLength,
            $self->paddingLength,
            $self->reserved
        ] = array_values(unpack(FCGI::HEADER_FORMAT, $data));

        $payload = substr($data, FCGI::HEADER_LEN);
        self::unpackPayload($self, $payload);
        if (get_called_class() !== __CLASS__ && $self->contentLength > 0) {
            static::unpackPayload($self, $payload);
        }

        return $self;
    }
865630
public function transform($data)
    {
        if (self::MODE_TO_PUBLIC === (self::MODE_TO_PUBLIC & $this->mode)) {
            return $this->map($data, UrlMapperInterface::MODE_INTERNAL_TO_PUBLIC);
        } else {
            return $data;
        }
    }
1338816
public function getSnippetsByLanguage($data) {
        $response=CodeBank_ClientAPI::responseBase();
        
        //Ensure logged in
        if(!Permission::check('CODE_BANK_ACCESS')) {
            $response['status']='EROR';
            $response['message']=_t('CodeBankAPI.PERMISSION_DENINED', '_Permission Denied');
            
            return $response;
        }
        
        
        $lang=SnippetLanguage::get()->byID(intval($data->id));
        if(!empty($lang) && $lang!==false && $lang->ID!=0 && $lang->Snippets()->Count()>0) {
            $snippets=$this->arrayUnmap($lang->Snippets()->filter('FolderID', 0)->map('ID', 'Title')->toArray());
            $response['data'][]=array(
                                    'id'=>$lang->ID,
                                    'language'=>$lang->Name,
                                    'folders'=>$this->mapFolders($lang->Folders()),
                                    'snippets'=>$snippets
                                );
        }
        
        
        return $response;
    }
334655
public function takeData($data)
    {
        if ($this->debug === true) {
            $fbRelations = [];
            $fbColumns   = $this->getColumnsInfo();
            foreach ($this->getRelationsInfo() as $relation) {
                if (is_array($relation) && isset($relation['url'])) {
                    $fbRelations[$relation['url']] = $relation['url'];
                }
            }
            if (count($fbColumns)) {
                foreach ($data as $key => $value) {
                    if (!array_key_exists($key, $fbColumns)) {

                        if (!array_key_exists($key, $fbRelations)) {
                            $this->addStatusMessage(sprintf('unknown column %s for evidence %s',
                                    $key, $this->getEvidence()), 'warning');
                        } else {
                            if (!is_array($value)) {
                                $this->addStatusMessage(sprintf('subevidence %s in evidence %s must bee an array',
                                        $key, $this->getEvidence()), 'warning');
                            }
                        }
                    }
                }
            }
        }
        return parent::takeData($data);
    }
1360350
protected function applyFormats($data)
    {
        if ($this->getOptions()->getOutputFormatters()) {

            foreach ($this->getOptions()->getOutputFormatters() as $formatter) {
                if ($formatter instanceof FormatterInterface) {
                    /** @var $formatter \PageBuilder\FormatterInterface */
                    $data = $formatter->format($data);
                } elseif (is_callable($formatter)) {
                    $data = $formatter($data, $this->serviceManager);
                }
            }
        }

        return $data;
    }
1080369
private function retrieveUsedFiltersType($data)
    {
        $usedTypes = array();
        foreach($data as $alias => $filterData) {
            if ($filterData['enabled'] == true){
                $filter = $this->getFilter($alias);
                if (!in_array($filter->applyOn(), $usedTypes)) {
                    array_push($usedTypes, $filter->applyOn());
                }
            }
        }
        
        return $usedTypes;
    }
871224
public function getParentGridData($data = [])
    {
        // filter out existing superfluous keys to reduce memory load
        // String comparisons are way too expensive, so we go for unset within some loops
        if (!empty($data['tx_gridelements_view_children'])) {
            foreach ($data['tx_gridelements_view_children'] as $child) {
                unset($data['tx_gridelements_view_child_' . $child['uid']]);
            }
        }
        if (!empty($data['tx_gridelements_view_columns'])) {
            foreach ($data['tx_gridelements_view_columns'] as $column => $content) {
                unset($data['tx_gridelements_view_column_' . $column]);
            }
        }

        unset($data['tx_gridelements_view_children']);
        unset($data['tx_gridelements_view_columns']);

        // Set parent grid data for the first time
        $parentGridData = $this->setParentGridData($data);

        // Now we can remove any parentgrid_parentgrid_ keys
        if (!empty($parentGridData)) {
            foreach ($parentGridData as $key => $value) {
                unset($data[$key]);
            }
        }

        // Set parentgrid data for the first time
        return $this->setParentGridData($data);
    }
505590
public function update($data)
    {
        if (isset($data['stackName'])) {
            $txt = Core::make('helper/text');
            $data['cName'] = $data['stackName'];
            $data['cHandle'] = str_replace('-', Config::get('concrete.seo.page_path_separator'), $txt->urlify($data['stackName']));
        }
        $worked = parent::update($data);

        if (isset($data['stackName'])) {
            // Make sure the stack path is always up-to-date after a name change
            $this->rescanCollectionPath();

            $db = Database::connection();
            $stackName = $data['stackName'];
            $db->Execute('update Stacks set stName = ? WHERE cID = ?', [$stackName, $this->getCollectionID()]);
        }

        return $worked;
    }
1122581
public static function table ($data)
	{
		$in = new self ();
		$in->setData ($data);
		$in->setOutput (new Table ());
		return $in;
	}
329574
private function resolveMainLanguageCode($data): string
    {
        return $data->isNew()
            ? $data->mainLanguageCode
            : $data->contentDraft->getVersionInfo()->getContentInfo()->mainLanguageCode;
    }
655991
public function doReplace($data)
    {
        $data = preg_replace_callback(
            '/#([^\s\r#]+)#/',
            function ($matches) {
                if (defined($matches[1])) {
                    return constant($matches[1]);
                }

                return $matches[0];
            },
            $data
        );

        if (isset($this->values)) {
            $values = $this->values;

            $data = preg_replace_callback(
                '/%([^\s\r%]+)%/',
                function ($matches) use ($values) {
                    if (isset($values[$matches[1]])) {
                        return $values[$matches[1]];
                    }

                    return $matches[0];
                },
                $data
            );
        }

        return $data;
    }
1325890
public static function getSubnet($data)
    {
        $subnet = null;

        if ($data instanceof IpInfo) {
            $subnet = $data->subnet;
        } elseif (is_array($data) && isset($data['subnet'])) {
            $subnet = $data['subnet'];
        } else {
            throw new IspecException('key "subnet" is missing');
        }

        return $subnet;
    }
330407
public function fromRawData($data)
    {
        $secretLength = VarInt::readUnsignedVarInt($data);
        $data = substr($data, $secretLength->getDataLength());

        $secretData = substr($data, 0, $secretLength->getValue());
        $data = substr($data, $secretLength->getValue());

        $verifyLength = VarInt::readUnsignedVarInt($data);
        $data = substr($data, $verifyLength->getDataLength());

        $verifyData = substr($data, 0, $verifyLength->getValue());

        $this->setToken($verifyData)->setSecret($secretData);
    }
83608
public function takeData($data)
    {
        $keyColumn = $this->getKeyColumn();
        if (array_key_exists($keyColumn, $data) && is_array($data[$keyColumn])) {
            foreach ($data[$keyColumn] as $recPos => $recordKey) {
                if (substr($recordKey, 0, 4) == 'ext:') {
                    $data['external-ids'][] = $recordKey;
                    unset($data[$keyColumn][$recPos]);
                }
            }
            if (count($data[$keyColumn]) == 1) {
                $data[$keyColumn] = current($data[$keyColumn]);
            }
        }
        $result = parent::takeData($data);

        if (array_key_exists($keyColumn, $data) || array_key_exists('kod', $data)) {
            $this->updateApiURL();
        }

        return $result;
    }