Commit 23bf93fb authored by Darryl Hamilton's avatar Darryl Hamilton
Browse files

Fix artefact fixer methods (bug #772976)



Change-Id: I1153b94bd7a24f3b0e5696bde0a81aebd5746322
Signed-off-by: default avatarDarryl Hamilton <darrylh@catalyst.net.nz>
parent 7328f045
......@@ -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