-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[Translation] [Config] Clear libxml errors after parsing xliff file #11908
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
Conversation
@@ -39,6 +54,7 @@ public function testLoadWithResname() | |||
$catalogue = $loader->load(__DIR__.'/../fixtures/resname.xlf', 'en', 'domain1'); | |||
|
|||
$this->assertEquals(array('foo' => 'bar', 'bar' => 'baz', 'baz' => 'foo'), $catalogue->all('domain1')); | |||
$this->assertEquals(array(), libxml_get_errors()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and the following two cases don't need asserting errors are empty. It is a duplicataction of the preceeding test cases and not really related to these ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, thanks.
39afac5
to
097b2fe
Compare
Actually, I think it's solved in a wrong place. The errors are coming from |
I agree with @jakzal that XmlUtils needs the same fix. However, the fix is indeed needed in this loader as it also performs some additional XML formatting |
@pulzarraider you can put it in the same PR |
@stof ok |
@pulzarraider can you standarize the order of calling |
$this->assertEquals(array(), libxml_get_errors()); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no need for two blank lines.
@pulzarraider Do you have some time in the coming days to finish this PR? |
@fabpot yes, I will finish it today evening. |
@pulzarraider Great! Thank you very much. |
097b2fe
to
fab61ef
Compare
👍 |
1 similar comment
👍 |
Thank you @pulzarraider. |
…liff file (pulzarraider) This PR was merged into the 2.3 branch. Discussion ---------- [Translation] [Config] Clear libxml errors after parsing xliff file | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - If libxml_use_internal_errors is set to `true` before parsing xliff file, the libxml errors are not cleared correctly. An error `Validation failed: no DTD found !` occurs in libxml errors after parsing and it's available outside the xliff parser (can break other functionality that use `libxml_get_errors` function). Commits ------- fab61ef [Translation] [Config] Clear libxml errors after parsing XML file
If libxml_use_internal_errors is set to
true
before parsing xliff file, the libxml errors are not cleared correctly. An errorValidation failed: no DTD found !
occurs in libxml errors after parsing and it's available outside the xliff parser (can break other functionality that uselibxml_get_errors
function).