Warning: simplexml_load_string

Created on 19 May 2021, about 3 years ago
Updated 12 May 2023, about 1 year ago

Problem/Motivation

When receiving a GlobalLink translation that has an & inside the received string, an error is generated in the simplexml_load_string function, which causes the process to terminate.

Steps to reproduce

1. Simulate a string received from GlobalLink that has an '&' inside it. Take the xml value from the attached xml_example.txt file and put it inside the $data variable.

$data = content of the xml_example.txt;

2. Simulate the function call in the same way as in GlobalLink on line 522 of the GlobalLinkTranslator.php class.
$ xml = simplexml_load_string($data, 'SimpleXMLElement', LIBXML_NOCDATA) or die ("Error: Cannot create object");

3. The die will be executed and the process will end.

Proposed resolution

Replace the possible '&' that may arrive within the received translation.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

2.2

Component

Code

Created by

πŸ‡¨πŸ‡΄Colombia yovanny.gomez.oyola

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024