From: Piotr Kosko
Date: Thu, 18 Jun 2015 06:57:40 +0000 (+0200)
Subject: [Content] Additional check for uri conversion
X-Git-Tag: submit/tizen/20150702.103311^2~2^2~36^2
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=af2d60f5a559811f9178cee88ee457c79c4a8578;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git
[Content] Additional check for uri conversion
[Verification] Code compiles without errors.
find() with contentURI filter works fine.
TCT passrate 100%.
Change-Id: I9994a6b8b8fbfdaaa14bcf07aba5c83bad06abdf
Signed-off-by: Piotr Kosko
---
diff --git a/src/content/content_filter.cc b/src/content/content_filter.cc
index a962c3ab..0d502b2f 100755
--- a/src/content/content_filter.cc
+++ b/src/content/content_filter.cc
@@ -141,8 +141,12 @@ PlatformResult ContentFilter::BuildQuery(const picojson::object& jsFilter,
matchValue = "4";
}
} else if (name == "contentURI") {
- //simple convertion of URI to globalpath
- matchValue = matchValue.substr(strlen("file://"));
+ const char* uri_prefix = "file://";
+ size_t found = matchValue.find(uri_prefix);
+ if (found != std::string::npos) {
+ //simple convertion of URI to globalpath
+ matchValue = matchValue.substr(found + strlen(uri_prefix));
+ }
}
switch (match_flag) {
case AttributeMatchFlag::kStartsWith :