Add support for processing only first occurence of allow-navigation.
authorZbigniew Kostrzewa <z.kostrzewa@samsung.com>
Fri, 12 Jul 2013 10:15:22 +0000 (12:15 +0200)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Tue, 16 Jul 2013 08:57:00 +0000 (08:57 +0000)
[Issue#] https://bugs.tizendev.org/jira/browse/TDIS-6856
[Problem] All allow-navigation elements from web application's
configuration document are parsed but only the first one
should be processed.
[Cause] N/A
[Solution] Process only the first occurrence of the allow-navigation
element.
[SCMRequest] Depends on: https://review.tizendev.org/80915
[Verification]
1. Build repository
2. Run test test/tct/wrt/tct-ext02-wrt-tests/setting-an-more

Change-Id: Ief2a0ce2f6a59b40c08df0fa90ffb04caa9377dc

src/configuration_parser/widget_parser.cpp

index 5fe45e4..4e510cd 100644 (file)
@@ -2108,7 +2108,8 @@ class AllowNavigationParser : public ElementParser
 
     virtual void Accept(const Text& text)
     {
-        if (m_properNamespace) {
+        if (m_properNamespace)
+        {
             m_origin = text.value;
         }
     }
@@ -2119,6 +2120,12 @@ class AllowNavigationParser : public ElementParser
 
     virtual void Verify()
     {
+        if (m_data.allowNavigationEncountered || !m_properNamespace)
+        {
+            return;
+        }
+        m_data.allowNavigationEncountered = true;
+
         if (m_origin.IsNull()) {
             LogWarning("data is empty");
             return;