Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/bug1073091 into lp:zorba

2013-01-16 Thread Sorin Marian Nasoi
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/bug1073091/+merge/139346
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/bug1073091 into lp:zorba

2013-01-16 Thread Sorin Marian Nasoi
The proposal to merge lp:~zorba-coders/zorba/bug1073091 into lp:zorba has been 
updated.

Status: Needs review = Approved

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/bug1073091/+merge/139346
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug1073091/+merge/139346
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/bug1073091 into lp:zorba

2013-01-16 Thread Zorba Build Bot
Validation queue starting for merge proposal.
Log at: 
http://zorbatest.lambda.nu:8080/remotequeue/bug1073091-2013-01-16T22-49-54.921Z/log.html
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug1073091/+merge/139346
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/bug1073091 into lp:zorba

2013-01-16 Thread noreply
The proposal to merge lp:~zorba-coders/zorba/bug1073091 into lp:zorba has been 
updated.

Status: Approved = Merged

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/bug1073091/+merge/139346
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug1073091/+merge/139346
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/bug1073091 into lp:zorba

2013-01-11 Thread Chris Hillery
Review: Approve

I changed the implementation slightly to use std::auto_ptr for memory-leak 
safety. If you could test to make sure I didn't break anything, I'd appreciate 
it.
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug1073091/+merge/139346
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp



Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/bug1073091 into lp:zorba

2013-01-08 Thread Juan Zacarias
I changed the implementation as you suggested.

 Unless I'm mistaken, there's no requirement that a fragment identifier must
 follow a forward-slash. The following is a valid URI with a fragment
 identifier:
 
   http://www.example.com/foobar#zot
 
 So the check for (lNormUri.at(found-1) == '/') is incorrect. Also I think it
 might cause a crash if the URI is the string # (which is probably not valid
 anyway, but still we shouldn't crash).
 
 More generally: I just spent a while reading RFC 3986 to see whether a simple
 character-search for '#' was sufficient to identify a fragment, when it
 occurred to me that I shouldn't be trying to answer that question manually. I
 think a better solution here would be to construct a zorba::URI object
 (src/zorbatypes/URI.h) from lNormUri and then call get_encoded_fragment() on
 it to see if there is any fragment. I don't like introducing that much
 overhead to perform this function, but parsing URIs is tricky and IMHO it
 makes sense to consolidate all of that functionality in a single place, namely
 the URI class.
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug1073091/+merge/139346
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/bug1073091 into lp:zorba

2012-12-11 Thread Juan Zacarias
Juan Zacarias has proposed merging lp:~zorba-coders/zorba/bug1073091 into 
lp:zorba.

Commit message:
The function fn:unparsed-text-available now return false for fragment 
identifiers
The functions fn:unparsed-text and fn:unparsed-text-lines now throw an error 
when trying to load a fragment identifier

Requested reviews:
  Chris Hillery (ceejatec)
  Sorin Marian Nasoi (sorin.marian.nasoi)
Related bugs:
  Bug #1073091 in Zorba: FOTS: fn:unparsed-text-lines bug
  https://bugs.launchpad.net/zorba/+bug/1073091

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/bug1073091/+merge/139346
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug1073091/+merge/139346
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/runtime/sequences/sequences_impl.cpp'
--- src/runtime/sequences/sequences_impl.cpp	2012-10-16 14:30:02 +
+++ src/runtime/sequences/sequences_impl.cpp	2012-12-11 23:52:21 +
@@ -1905,9 +1905,22 @@
   store::Item_t oResult)
 {
   //Normalize input to handle filesystem paths, etc.
-  zstring lNormUri;
+  zstring lNormUri;  
+  size_t found = 0;
+
   normalizeInputUri(aUri, aSctx, loc, lNormUri);
 
+  //check if fragment identifier
+  found = lNormUri.find_last_of(#);
+  if (found != lNormUri.npos)
+  {
+//confirm if fragment
+if (lNormUri.at(found-1) == '/')
+{
+  throw XQUERY_EXCEPTION(err::FOUT1170, ERROR_PARAMS(aUri), ERROR_LOC(loc));
+} 
+  }
+
   //Resolve URI to stream
   zstring lErrorMessage;
   std::auto_ptrinternal::Resource lResource = aSctx-resolve_uri
@@ -2040,6 +2053,7 @@
   zstring lErrorMessage;
   std::auto_ptrinternal::Resource lResource;
   StreamReleaser lStreamReleaser;
+  size_t found = 0;
 
   FnUnparsedTextLinesIteratorState* state;
   DEFAULT_STACK_INIT(FnUnparsedTextLinesIteratorState, state, planState);
@@ -2059,6 +2073,17 @@
   uriItem-getStringValue2(uriString);
   normalizeInputUri(uriString, theSctx, loc, lNormUri);
 
+  //check if fragment identifier
+  found = lNormUri.find_last_of(#);
+  if (found != lNormUri.npos)
+  {
+//confirm if fragment
+if (lNormUri.at(found-1) == '/')
+{
+  throw XQUERY_EXCEPTION(err::FOUT1170, ERROR_PARAMS(uriString), ERROR_LOC(loc));
+} 
+  }
+
   //Resolve URI to stream
   lResource = theSctx-resolve_uri
 (lNormUri, internal::EntityData::SOME_CONTENT, lErrorMessage);

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/bug1073091 into lp:zorba

2012-12-11 Thread Chris Hillery
Review: Needs Fixing

Unless I'm mistaken, there's no requirement that a fragment identifier must 
follow a forward-slash. The following is a valid URI with a fragment identifier:

  http://www.example.com/foobar#zot

So the check for (lNormUri.at(found-1) == '/') is incorrect. Also I think it 
might cause a crash if the URI is the string # (which is probably not valid 
anyway, but still we shouldn't crash).

More generally: I just spent a while reading RFC 3986 to see whether a simple 
character-search for '#' was sufficient to identify a fragment, when it 
occurred to me that I shouldn't be trying to answer that question manually. I 
think a better solution here would be to construct a zorba::URI object 
(src/zorbatypes/URI.h) from lNormUri and then call get_encoded_fragment() on it 
to see if there is any fragment. I don't like introducing that much overhead to 
perform this function, but parsing URIs is tricky and IMHO it makes sense to 
consolidate all of that functionality in a single place, namely the URI class.
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug1073091/+merge/139346
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp