When pasting a URL that contains an https:// prefix, the prefix itself isn't stripped from the output. This results in the video being inserted, but "https://" is displayed in plain text just before the video itself.

Comments

azrael3x’s picture

integrate expression:

at line 135 of module file

#(((http://)?)|(^./))(((www.)?)|(^./))youtube\.com/watch[?]v=([^\[\]()<.,\s\n\t\r]+)(?![^<]*)#i

with "(s)?"

#(((http(s)?://)?)|(^./))(((www.)?)|(^./))youtube\.com/watch[?]v=([^\[\]()<.,\s\n\t\r]+)(?![^<]*)#i

Andrzej7’s picture

Thanks azrael3x, but it doesn't work for Drupal6 and 7
your code is about 40 line (D6), after change

   if (preg_match_all('#(((http(s)?://)?)|(^./))(((www.)?)|(^./))youtube\.com/watch[?]v=([^\[\]()<.,\s\n\t\r]+)(?![^<]*)#i', $text, $matches)); {
        foreach ($matches[0] as $mi => $match) {
	      $replace = googtube_youtube($match, $filter);
          $text = str_replace($match, $replace, $text);
        };
	  }

all youtube links makes a simple link.

Any help?

wrebis’s picture

the line should be:
if (preg_match_all('#(((https?://)?)|(^./))(((www.)?)|(^./))youtube\.com/watch[?]v=([^\[\]()<.,\s\n\t\r]+)(?![^<]*</a>)#i', $text, $matches)); {

Andrzej7’s picture

Thanks

it works :-)

federico’s picture

Works for me too.

tikaszvince’s picture

Status: Active » Needs review
StatusFileSize
new1.2 KB

I attach a patch about the modification of @wrebus.

bobbia’s picture

This patch worked for me, also. I no longer see the https:// before the video.

I would imagine that most people will need this patch now that all of YouTube's videos start with https://.

Thanks!