News:

Wondering if this will always be free?  See why free is better.

Main Menu

[url] BBcode is not parsing "file://"

Started by ymep, January 05, 2005, 03:54:27 AM

Previous topic - Next topic

ymep

Hi Guys
I'm using smf as intranet forum
and sometimes I need that functionality to share some resources over MSNetwork or Samba
I used to phpBB. It was working correctly both with BBcode and simple html:


<a href=file:////computer_name//resource_name>\\Computer_name\resourse_name<a/>



[url=file:////computer_name//resource_name]\\Computer_name\resourse_name[/url]


it is looks like a link but if local IE user click this link hi is getting the resource
I think You know what I'm talking about...

How can I get that in SMF

Thanks,
Nikolay


[Unknown]

We don't consider this to be working "correctly" in live (non-intranet) forums.  However, you can modify the code to make it do as you want... find this in Subs-Post.php:

if (!stristr($replace, $protocol . '://'))

Replace:

if (!stristr($replace, 'file://'))
$replace = stristr($replace, 'file://');
elseif (!stristr($replace, $protocol . '://'))


That should allow it.  Be careful, and remember that security isn't as high in these cases...

-[Unknown]

ymep


jalsin

Hello -

I am using SMF 1.1 RC1 and attempting to link files.  I read below where I can locate "if (!stristr($replace, $protocol . '://'))" and change it to accept file:// as well.
But... I do not have that syntax in my Subs-Post.php file, therefore I am unsure what I need to do to be able to link to files.

Any suggestions would be great as I am new to PHP.

Thank you!

- joey

doddy

Just wondering if you have magaed to fix this problem yet as I too want to be able to do this.

Any help would be appreciated!!

Cheers

ibernet


Arantor

The url bbcode is expressly designed not to process file urls for security reasons, never mind that browsers have issues with it too when linking from an http resource to a file resource.

Why, exactly, do you need to do this?

Oldiesmann

If you really want to do this...

Sources/Subs.php

Find (twice):
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)

Replace (twice):
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0 && strpos($data, \'file://\') !== 0)

Note that this will only fix it for the url tag. If you want it to auto-link file:// URLs as well, you'll have to hack the code a bit more.
Michael Eshom
Christian Metal Fans

Arantor

That's not the only place in 2.0 you have to change it, there's also a place in the preparser where it validates the url tags.

ibernet

Hi all,
can you help for resolve this problem?

I need make link in folder of my Intranet

Advertisement: