[rygel] core: Don't allow comments in DIDL-Lite
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] core: Don't allow comments in DIDL-Lite
- Date: Wed, 2 Jun 2010 12:12:26 +0000 (UTC)
commit 35f01c47b39f9cfdae581952f414d55394026289
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Wed May 26 23:54:21 2010 +0300
core: Don't allow comments in DIDL-Lite
Don't allow comments in DIDL-Lite in 'Elements' argument of CreatObject.
src/rygel/rygel-item-creator.vala | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/rygel/rygel-item-creator.vala b/src/rygel/rygel-item-creator.vala
index e656d2e..dd943c5 100644
--- a/src/rygel/rygel-item-creator.vala
+++ b/src/rygel/rygel-item-creator.vala
@@ -30,6 +30,8 @@ private errordomain Rygel.ItemCreatorError {
* CreateObject action implementation.
*/
internal class Rygel.ItemCreator: GLib.Object, Rygel.StateMachine {
+ private static PatternSpec comment_pattern = new PatternSpec ("*<!--*-->*");
+
// In arguments
public string container_id;
public string elements;
@@ -94,6 +96,9 @@ internal class Rygel.ItemCreator: GLib.Object, Rygel.StateMachine {
if (this.elements == null) {
throw new ContentDirectoryError.BAD_METADATA (
_("'Elements' argument missing."));
+ } else if (comment_pattern.match_string (this.elements)) {
+ throw new ContentDirectoryError.BAD_METADATA (
+ _("Comments not allowed in XML"));
}
if (this.container_id == null) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]