Problem mit https-Links

Please report bugs here!

Moderator: Thorsten

Post Reply
Matthias Diehl
Posts: 6
Joined: Sun Nov 30, 2003 12:32 pm

Problem mit https-Links

Post by Matthias Diehl »

Hallo,
Zuerst einmal vielen Dank für diese grossartige Software!
Ich habe sie gestern abend installiert und habe direkt die erste Frage. Ich möchte in einer FAQ auf einen sicheren Link hinweisen.
Mit Hilfe des UBB-Codes bekomme ich das leider nicht hin. Denn wenn ich

Code: Select all

https://sichere.seite.de
(das ist nur ein Beispiel!) eingebe, wandelt er den Link immer um in

Code: Select all

http://https://sichere.seite.de
Hat da jemand einen Tipp für mich ?

Danke
Matthias
Thorsten
Posts: 15724
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hallo Matthias,

das werde ich mal überprüfen.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Thorsten
Posts: 15724
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hallo Matthias,

öffne mal die functions.php und tausche die Funktion parseUBB gegen diese aus:

Code: Select all

function parseUBB($ret)
{
    $ret = stripslashes($ret);
    $pattern = array(   '{\[b\](.*)\[/b\]}smUi',
                        '{\[u\](.*)\[/u\]}smUi',
                        '{\[i\](.*)\[/i\]}smUi',
                        '{\[ul\](.*)\[/ul\]}smUi',
                        '{\[li\](.*)\[/li\]}smUi',
                        '{\[url=(.*)\](.*)\[/url\]}smUi',
                        '{\[url\](.*)\[/url\]}smUi',
                        '{\[urls=(.*)\](.*)\[/urls\]}smUi',
                        '{\[urls\](.*)\[/urls\]}smUi',
                        '{\[img\](.*)\[/img\]}smUi',
                        '{\[size=(.*)\](.*)\[/size\]}smUi',
                        '{\[color=(.*)\](.*)\[/color\]}smUi',
                        '{\[align=(.*)\](.*)\[/align\]}smUi',
                        '{\[\\\\\]}smUi',
                        '{\[center\](.*)\[/center\]}smUi',
                        '{\[(h[1-6]+)\](.*)\[/\\1\]}smUi',
                        '{\[email\](.*)\[/email\]}smUi',
                        '{\[fimg\](.*)\[/fimg\]}smUi',
                        '{\[fimg desc=(.*)\](.*)\[/fimg\]}smUi',
                        '{\[quote\](.*)\[/quote\]}smUi',
                        '{\[email\](.*)\[/email\]}smUi'
                        );
    $replace = array(   '<b>\\1</b>',
                        '<u>\\1</u>',
                        '<i>\\1</i>',
                        '<ul>\\1</ul>',
                        '<li>\\1</li>',
                        '<a href="http://\\1" target="_blank">\\2</a>',
                        '<a href="http://\\1" target="_blank">\\1</a>',
                        '<a href="https://\\1" target="_blank">\\2</a>',
                        '<a href="https://\\1" target="_blank">\\1</a>',
                        '<img src="\\1" border="0">',
                        '<span style="font-size: \\1px;">\\2</span>',
                        '<span style="color: \\1;">\\2</span>',
                        '<div align="\\1">\\2</div>',
                        '\\\\'.'\n',
                        '<div align="center">\\1</div>',
                        '<\\1>\\2</\\1>',
                        '<a href="mailto:\\1">\\1</a>',
                        '<img src="./images/\\1" border="0">',
                        '<img src="./images/\\2" border="0" alt="\\1" onMouseOver="'."self.status='\\1'; return(true);".'" onMouseOut="'."self.status=''; return(true);".'">',
                        '<table width="90%" border="0" cellspacing="2" cellpadding="2" align="center" style="border: 1px dashed black;"><tr><td>Quote:<br />\\1</td></tr></table>',
                        '<a href="http://mailto:\\1">\\1</a>'
                        );
    
    $ret = preg_replace($pattern,$replace,$ret);
    $ret = preg_replace_callback("#\[php\](.*)\[\/php\]#Usi","php_syntax", $ret);
    $ret = preg_replace_callback("#\[code\](.*)\[\/code\]#Usi","code_syntax", $ret);
    $ret = preg_replace_callback("#\[lart=(.*) lang=(.*)]#Usi","internalLink", $ret);
    
    $ret = str_replace('http://http://','http://',$ret);
    return $ret;
}
Über die Tags [urls] kannst du nun https:// Links setzen.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
meikel
Posts: 135
Joined: Wed Feb 12, 2003 11:12 am
Location: Erfurt
Contact:

Re: Problem mit https-Links

Post by meikel »

Matthias Diehl wrote:Ich möchte in einer FAQ auf einen sicheren Link hinweisen. Mit Hilfe des UBB-Codes bekomme ich das leider nicht hin. Denn wenn ich

Code: Select all

https://sichere.seite.de
(das ist nur ein Beispiel!) eingebe, wandelt er den Link immer um in

Code: Select all

http://https://sichere.seite.de
Hat da jemand einen Tipp für mich ?
Ja. Suche in ./inc/functions.php die Funktion parseUBB und dort die Zeile

Code: Select all

$ret = str_replace('http://http://','http://',$ret);
Die änderst Du so ab, daß dort

Code: Select all

$ret = str_replace('http://http://','http://',$ret);
$ret = str_replace('http://https://','https://',$ret);
steht.
Matthias Diehl
Posts: 6
Joined: Sun Nov 30, 2003 12:32 pm

Danke !

Post by Matthias Diehl »

Vielen Dank Euch beiden.
Ich werde beide Versionen mal durchprobieren.....
Matthias Diehl
Posts: 6
Joined: Sun Nov 30, 2003 12:32 pm

Post by Matthias Diehl »

Also ich werde jetzt bei meikels Version bleiben, dann kann ich nichts verwechseln :)
Nochmals Danke für die schnelle Hilfe.
Thorsten
Posts: 15724
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi Matthias,

Meikels Lösung ist auch besser. :-)

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply