Commit 7e530034 authored by Francois Marier's avatar Francois Marier Committed by Gerrit Code Review
Browse files

Merge "Fix artefact fixer methods (bug #772976)"

parents 3c937b9e 23bf93fb
......@@ -961,8 +961,9 @@ class PluginImportLeap extends PluginImport {
* @return boolean Whether it's worth checking in more detail
*/
private function artefact_reference_quickcheck($field) {
$ns = $this->namespaces[$this->leap2anamespace];
return (false !== strpos($field, 'rel="'.$this->leap2anamespace.':has_part"')
return (false !== strpos($field, 'rel="'.$ns.':has_part"')
|| false !== strpos($field, 'rel="enclosure"'))
&& (
(false !== strpos($field, '<img'))
......@@ -977,7 +978,9 @@ class PluginImportLeap extends PluginImport {
* @return string The fixed field
*/
private function fix_artefact_reference($field) {
$match = '#<((img)|a)([^>]+)rel="(?:'.$this->leap2anamespace.':has_part|enclosure)" (?:src|href)="([^"]+)"([^>]*)>#';
$ns = $this->namespaces[$this->leap2anamespace];
$match = '#<((img)|a)([^>]+)rel="(?:'.$ns.':has_part|enclosure)" (?:src|href)="([^"]+)"([^>]*)>#';
$field = preg_replace_callback($match,
array($this, '_fixref'),
$field);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment