Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
7e530034
Commit
7e530034
authored
May 02, 2011
by
Francois Marier
Committed by
Gerrit Code Review
May 02, 2011
Browse files
Merge "Fix artefact fixer methods (bug #772976)"
parents
3c937b9e
23bf93fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/import/leap/lib.php
View file @
7e530034
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment