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
fc2f43ad
Commit
fc2f43ad
authored
Jan 16, 2007
by
Richard Mansfield
Browse files
Only re-update image tags in post body when body has links to newly
uploaded images
parent
f36e6976
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/blog/saveblogpost.json.php
View file @
fc2f43ad
...
...
@@ -109,6 +109,7 @@ if (!empty($uploads)) {
// we need to go through the body of the post and change the 'src' and
// 'alt' attributes of all images that refer to uploaded files.
if
(
!
empty
(
$uploadartefact
))
{
$originalbody
=
$body
;
foreach
(
$uploadartefact
as
$k
=>
$v
)
{
$regexps
=
array
(
'/\/artefact\/blog\/downloadtemp.php\?uploadnumber='
.
$k
.
'&createid=\d+/'
,
'/alt="uploaded:'
.
$k
.
'"/'
);
...
...
@@ -116,8 +117,10 @@ if (!empty($uploadartefact)) {
'alt="artefact:'
.
$v
.
'"'
);
$body
=
preg_replace
(
$regexps
,
$subs
,
$body
);
}
$postobj
->
set
(
'description'
,
$body
);
$postobj
->
commit
();
if
(
$body
!=
$originalbody
)
{
$postobj
->
set
(
'description'
,
$body
);
$postobj
->
commit
();
}
}
json_reply
(
false
,
get_string
(
'blogpostsaved'
,
'artefact.blog'
));
...
...
Write
Preview
Supports
Markdown
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