Skip to content

Commit

Permalink
Drop usage of xml_set_object()
Browse files Browse the repository at this point in the history
And use normal callables instead of ext/xml's strange feature
  • Loading branch information
Girgias committed Dec 1, 2023
1 parent 15919fd commit cea90ab
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions engine/Library/Zend/Translate/Adapter/XmlTm.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@ protected function _loadTranslationData($filename, $locale, array $options = arr

$encoding = $this->_findEncoding($filename);
$this->_file = xml_parser_create($encoding);
xml_set_object($this->_file, $this);
xml_parser_set_option($this->_file, XML_OPTION_CASE_FOLDING, 0);
xml_set_element_handler($this->_file, "_startElement", "_endElement");
xml_set_character_data_handler($this->_file, "_contentElement");
xml_set_element_handler($this->_file, [$this, "_startElement"], [$this, "_endElement"]);
xml_set_character_data_handler($this->_file, [$this, "_contentElement"]);

if (!xml_parse($this->_file, file_get_contents($filename))) {
$ex = sprintf('XML error: %s at line %d of file %s',
Expand Down

0 comments on commit cea90ab

Please sign in to comment.