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
2b8ccd00
Commit
2b8ccd00
authored
Jan 18, 2013
by
Melissa Draper
Committed by
Gerrit Code Review
Jan 18, 2013
Browse files
Merge "Additional processing fixes for rss to avoid fatal errors (Bug #1081431)"
parents
47094212
129e2627
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/blocktype/externalfeed/lib.php
View file @
2b8ccd00
...
@@ -64,8 +64,15 @@ class PluginBlocktypeExternalfeed extends SystemBlocktype {
...
@@ -64,8 +64,15 @@ class PluginBlocktypeExternalfeed extends SystemBlocktype {
$data
=
$instance
->
get_data
(
'feed'
,
$configdata
[
'feedid'
]);
$data
=
$instance
->
get_data
(
'feed'
,
$configdata
[
'feedid'
]);
$data
->
content
=
unserialize
(
$data
->
content
);
if
(
isset
(
$data
)
&&
is_string
(
$data
->
content
))
{
$data
->
image
=
unserialize
(
$data
->
image
);
$data
->
content
=
unserialize
(
$data
->
content
);
}
if
(
isset
(
$data
)
&&
(
is_string
(
$data
->
image
)
||
is_array
(
$data
->
image
)))
{
$data
->
image
=
@
unserialize
(
$data
->
image
);
}
else
{
$data
->
image
=
null
;
}
// only keep the number of entries the user asked for
// only keep the number of entries the user asked for
if
(
count
(
$data
->
content
))
{
if
(
count
(
$data
->
content
))
{
...
@@ -285,17 +292,30 @@ class PluginBlocktypeExternalfeed extends SystemBlocktype {
...
@@ -285,17 +292,30 @@ class PluginBlocktypeExternalfeed extends SystemBlocktype {
}
}
try
{
try
{
$data
=
self
::
parse_feed
(
$feed
->
url
,
$feed
->
insecuresslmode
,
$feed
->
authuser
,
$feed
->
authpassword
);
$data
=
self
::
parse_feed
(
$feed
->
url
,
$feed
->
insecuresslmode
,
$feed
->
authuser
,
$feed
->
authpassword
);
$data
->
id
=
$feed
->
id
;
$data
->
lastupdate
=
db_format_timestamp
(
time
());
$data
->
content
=
serialize
(
$data
->
content
);
$data
->
image
=
serialize
(
$data
->
image
);
update_record
(
'blocktype_externalfeed_data'
,
$data
);
}
}
catch
(
XML_Feed_Parser_Exception
$e
)
{
catch
(
XML_Feed_Parser_Exception
$e
)
{
// The feed must have changed in such a way as to become
// The feed must have changed in such a way as to become
// invalid since it was added. We ignore this case in the hope
// invalid since it was added. We ignore this case in the hope
// the feed will become valid some time later
// the feed will become valid some time later
}
}
if
(
isset
(
$data
)
&&
$data
instanceof
XML_Feed_Parser_Exception
)
{
continue
;
}
else
if
(
isset
(
$data
))
{
if
(
!
isset
(
$data
->
image
))
{
$data
->
image
=
null
;
}
try
{
$data
->
content
=
$data
->
content
?
serialize
(
$data
->
content
)
:
''
;
$data
->
image
=
$data
->
image
?
serialize
(
$data
->
image
)
:
''
;
$data
->
id
=
$feed
->
id
;
$data
->
lastupdate
=
db_format_timestamp
(
time
());
update_record
(
'blocktype_externalfeed_data'
,
$data
);
}
catch
(
XML_Feed_Parser_Exception
$e
)
{
// We tried to add the newly parsed data
}
}
}
}
}
}
...
...
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