Project:Link
Version:6.x-2.9
Component:Code
Category:feature request
Priority:normal
Assigned:jcfiala
Status:closed (fixed)

Issue Summary

That is, the string between the first occurence of '//' and the first occurence of '/' thereafter. The attached patch provides this.

AttachmentSize
link-host.patch673 bytes

Comments

#1

Reworked the patch to be more simple and (hopefully) even a bit faster.

AttachmentSize
link-host-609560-1.patch 608 bytes

#2

Oh my goodness, seems like there are still folks out there who use php4... Patch updated accordingly.

AttachmentSize
link-host-609560-2.patch 622 bytes

#3

Status:needs review» reviewed & tested by the community

checked this patch, 3 simple lines, works as expected

#4

Version:6.x-2.6» 6.x-2.9
Status:reviewed & tested by the community» needs review

Rerolled patch to make it cleanly apply to 6.x-2.9 (previous one had only offset warnings).

AttachmentSize
link-609560-4.patch 622 bytes

#5

Added some error handling as chx requested.

AttachmentSize
link-609560-5.patch 650 bytes

#6

Assigned to:Anonymous» jcfiala

Hey, keen!

I'm assigning to myself so I'll find an incorporate it the next time I'm adding code to the Link module. (There's really quite a lot of tickets, and it's easy to lose them.)

#7

Status:needs review» reviewed & tested by the community

#8

Coolness - I see chx approves.

I'll be including it either way, but for bonus love from me, create a simpletest test that shows that your token works!

(Of course, you may not want bonus love from me. :)

#9

Status:reviewed & tested by the community» needs review

Here you are.

AttachmentSize
link-609560-6.patch 3.25 KB

#10

Downloaded the patch, created a link field containing the token, ran the simpletests - all went as expected. Maybe rename the test from testUserTokenLinkCreate2 to something more descriptive, like testHostTokenLinkCreate?

#11

Here it is.

AttachmentSize
link-609560-7.patch 3.24 KB

#12

Status:needs review» reviewed & tested by the community

Looks good

#13

Hello,
Thank you very much for this patch. It worked perfectly but I was wondering if it is possible to remove also the "www" and "com", "net" etc part of the hostname.
Thank you in advance for your help.
Nik

#14

Status:reviewed & tested by the community» fixed

Committed!

#15

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here