Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.3] Replace xml_set_object with proper callable parameters #44490

Draft
wants to merge 3 commits into
base: 5.3-dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions libraries/src/Changelog/Changelog.php
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,8 @@ public function loadFromXml($url)
$this->currentChangelog = new \stdClass();

$this->xmlParser = xml_parser_create('');
xml_set_object($this->xmlParser, $this);
xml_set_element_handler($this->xmlParser, 'startElement', 'endElement');
xml_set_character_data_handler($this->xmlParser, 'characterData');
xml_set_element_handler($this->xmlParser, [$this, 'startElement'], [$this, 'endElement']);
xml_set_character_data_handler($this->xmlParser, [$this, 'characterData']);

if (!xml_parse($this->xmlParser, $response->body)) {
Log::add(
Expand Down
3 changes: 1 addition & 2 deletions libraries/src/Updater/Adapter/CollectionAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,7 @@ public function findUpdate($options)
}

$this->xmlParser = xml_parser_create('');
xml_set_object($this->xmlParser, $this);
xml_set_element_handler($this->xmlParser, '_startElement', '_endElement');
xml_set_element_handler($this->xmlParser, [$this, '_startElement'], [$this, '_endElement']);

if (!xml_parse($this->xmlParser, $response->body)) {
// If the URL is missing the .xml extension, try appending it and retry loading the update
Expand Down
5 changes: 2 additions & 3 deletions libraries/src/Updater/Adapter/ExtensionAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,8 @@ public function findUpdate($options)
}

$this->xmlParser = xml_parser_create('');
xml_set_object($this->xmlParser, $this);
xml_set_element_handler($this->xmlParser, '_startElement', '_endElement');
xml_set_character_data_handler($this->xmlParser, '_characterData');
xml_set_element_handler($this->xmlParser, [$this, '_startElement'], [$this, '_endElement']);
xml_set_character_data_handler($this->xmlParser, [$this, '_characterData']);

if (!xml_parse($this->xmlParser, $response->body)) {
// If the URL is missing the .xml extension, try appending it and retry loading the update
Expand Down
5 changes: 2 additions & 3 deletions libraries/src/Updater/Update.php
Original file line number Diff line number Diff line change
Expand Up @@ -657,9 +657,8 @@ public function loadFromXml($url, $minimumStability = Updater::STABILITY_STABLE,
$this->channel = $channel;

$this->xmlParser = xml_parser_create('');
xml_set_object($this->xmlParser, $this);
xml_set_element_handler($this->xmlParser, '_startElement', '_endElement');
xml_set_character_data_handler($this->xmlParser, '_characterData');
xml_set_element_handler($this->xmlParser, [$this, '_startElement'], [$this, '_endElement']);
xml_set_character_data_handler($this->xmlParser, [$this, '_characterData']);

if (!xml_parse($this->xmlParser, $response->body)) {
Log::add(
Expand Down