[OGo-Developer] WOHyperlink href rewriting

Helge Hess developer@opengroupware.org
Sat, 2 Feb 2008 11:39:55 +0100


On 01.02.2008, at 15:45, St=E9phane Corth=E9sy wrote:
>> I think the code currently assumes that you use the =20
>> 'fragmentIdentifier' binding if you want to generate just the =20
>> #fragment.
> Hmm, well, no: you may not bind only 'fragmentIdentifier': you need =20=

> to bind at least href | pageName | action | (directActionName & =20
> actionClass).

Hm, should we consider this a bug?

>> Here we probably want to change -shouldRewriteURLString: to return =20=

>> NO if the string starts with a #.
> Agreed.

OK, did that.

>>> If I put 'http://another.server.com' in href, WOHyperlink tries an =20=

>>> fails to rewrite URL. It shouldn't even touch it.
>> Hm, in this case [NSURL -stringValueRelativeToURL:] apparently =20
>> doesn't check the host properly. Not sure how that can happen, will =20=

>> need to check this.

I had a look and the code looks reasonable I think. Its in sope-core/=20
NGExtensions/FdExt/NSURL+misc.m. There is a

   debugURLProcessing

constant. Maybe you could enable that and have a look what goes wrong?

> (Writing some tests for such basic but often used feature would help =20=

> development.)

Definitely, contributions are very welcome! ;-)

Thanks,
   Helge
--=20
Helge Hess
http://www.helgehess.eu/=