Closed (fixed)
Project:
Googtube
Version:
5.x-1.x-dev
Component:
code
Priority:
Minor
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
11 Oct 2007 at 15:08 UTC
Updated:
2 Apr 2009 at 02:21 UTC
Googtube works perfectly well for me apart from one thing: if my readers embed a URL from the UK version of YouTube, the http://uk. part of the URL is shown on the page above the video. Any suggestions to resolve this?
Thanks in advance.
Comments
Comment #1
fnapo commentedI'm using the Italian version, and I've the same issue. Probably easy to solve with regexp, but don't know how :) This is the code I get in the post:
BTW, excellent module, i had the same problem with multiple players in one pages, but solved with reordering.
Thanks
Comment #2
muka commentedciao
i'm using this (nearly line 50 of googtube.module file)
$text = preg_replace_callback('!(((http://)?)|(^./))(((www.)?)|(^./))(([a-zA-Z]{2,5}[.])?|(^./))youtube\.com/watch[?]v=([^\[\]()<.,\s\n\t\r]+)(((&|&).+[^< ])?)!i', 'googtube_youtube', $text);
not sure if it's correctly structured but seems to work.
I've added
(([a-zA-Z]{2,5}[.])?|(^./))
and that should resolve the bug of http://it. not replaced
I've appended either
(((&|&).+[^< ])?)
to the regex's end in case of link like
http://youtube.com?v=key&related=...
are inserted
the char that delimits the end of the url is a space or a < (another word or a new tag)
bye,
Luca from the http://valsuganagiovani.it team
Comment #3
ssutankayo commentedsomehow the (([a-zA-Z]{2,5}[.])?|(^./)) addition doesn't work for me but i'm not sure why it wouldn't. but it's not a big priority for now.
Comment #4
alexandreracine commentedIf someone create a patch against the 5.x-dev module for this problem, put it here with a couple of example urls, I'll test it and commit the code.
Comment #5
alexandreracine commentedReopen if someone have a patch.