Links error

Started by Black, June 03, 2013, 03:26:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Black

Quote from: Mindless on June 26, 2013, 05:19:28 PM
Nice one mate - will add your fix to github once its verified =]

no problem ;) tnx u :)

Mindless

Nice one mate - will add your fix to github once its verified =]

Black

i fix this...

bbcode_functions.php
  // BBCode to find...
$bb_code_in = array('/\[b\]\s*((\s|.)+?)\s*\[\/b\]/i',
'/\[i\]\s*((\s|.)+?)\s*\[\/i\]/i',
'/\[u\]\s*((\s|.)+?)\s*\[\/u\]/i',
'/\[email\](.*?)\[\/email\]/i',
'/\[align=([a-zA-Z]+)\]((\s|.)+?)\[\/align\]/i',
'/\[blockquote\]\s*((\s|.)+?)\s*\[\/blockquote\]/i',
'/\[strike\]\s*((\s|.)+?)\s*\[\/strike\]/i',
'/\[s\]\s*((\s|.)+?)\s*\[\/s\]/i',
'/\[pre\]\s*((\s|.)+?)\s*\[\/pre\]/i',
'/\[marquee\](.*?)\[\/marquee\]/i',
'/\[collapse=(.*?)\]\s*((\s|.)+?)\s*\[\/collapse\]/i',
'/\[size=([1-7])\]\s*((\s|.)+?)\s*\[\/size\]/i',
'/\[color=([a-zA-Z]+)\]\s*((\s|.)+?)\s*\[\/color\]/i',
'/\[color=(#[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9])\]\s*((\s|.)+?)\s*\[\/color\]/i',
'/\[font=([a-zA-Z ,]+)\]((\s|.)+?)\[\/font\]/i',
'/\[quote\]\s*((\s|.)+?)\s*\[\/quote\]/i',
'/\[quote=(.+?)\]\s*((\s|.)+?)\s*\[\/quote\]/i',
'/\[spoiler\]\s*((\s|.)+?)\s*\[\/spoiler\]/i',
'/\[video=[^\s\'"<>]*youtube.com.*v=([^\s\'"<>]+)\]/ims',
"/\[video=[^\s'\"<>]*video.google.com.*docid=(-?[0-9]+).*\]/ims",
'/\[audio\](http:\/\/[^\s\'"<>]+(\.(mp3|aiff|wav)))\[\/audio\]/i',
'/\[list=([0-9]+)\]((\s|.)+?)\[\/list\]/i',
'/\[list\]((\s|.)+?)\[\/list\]/i',
'/\[\*\]\s?(.*?)\n/i',
'/\[li\]\s?(.*?)\n/i',
'/\[hr\]/');
  // And replace them by...
$bb_code_out = array('<span style="font-weight: bold;">\1</span>',
'<span style="font-style: italic;">\1</span>',
'<span style="text-decoration: underline;">\1</span>',
'<a class="altlink" href="mailto:\1">\1</a>',
'<span style="text-align: \1;">\2</span>',
'<blockquote class="style"><span>\1</span></blockquote>',
'<span style="text-decoration: line-through;">\1</span>',
'<span style="text-decoration: line-through;">\1</span>',
'<span style="white-space: nowrap;">\1</span>',
'<marquee class="style">\1</marquee>',
'<div style="padding-top: 2px; white-space: nowrap"><span style="cursor: hand; cursor: pointer; border-bottom: 1px dotted" onclick="if (document.getElementById(\'collapseobj\1\').style.display==\'block\') {document.getElementById(\'collapseobj\1\').style.display=\'none\' } else { document.getElementById(\'collapseobj\1\').style.display=\'block\' }">\1</span></div><div id="collapseobj\1" style="display:none; padding-top: 2px; padding-left: 14px; margin-bottom:10px; padding-bottom: 2px; background-color: #FEFEF4;">\2</div>',
'<span class="font_size_\1">\2</span>',
'<span style="color:\1;">\2</span>',
'<span style="color:\1;">\2</span>',
'<span style="font-family:\'\1\';">\2</span>',
'<table cellspacing="0" cellpadding="10"><tr><td class="forum_head_dark" style="padding:5px">Quote:</td></tr><tr><td style="border: 1px black dotted">\\1</td></tr></table><br />',
'<table cellspacing="0" cellpadding="10"><tr><td class="forum_head_dark" style="padding:5px">\\1 wrote:</td></tr><tr><td style="border: 1px black dotted">\\2</td></tr></table><br />',
'<table cellspacing="0" cellpadding="10"><tr><td class="forum_head_dark" style="padding:5px">Spoiler! to view, roll over the spoiler box.</td></tr><tr><td class="spoiler"><a href="#">\\1</a></td></tr></table><br />',
'<object width="500" height="410"><param name="movie" value="http://www.youtube.com/v/\1"></param><embed src="http://www.youtube.com/v/\\1" type="application/x-shockwave-flash" width="500" height="410"></embed></object>',
"<embed style=\"width:500px; height:410px;\" id=\"VideoPlayback\" align=\"middle\" type=\"application/x-shockwave-flash\" src=\"http://video.google.com/googleplayer.swf?docId=\\1\" allowScriptAccess=\"sameDomain\" quality=\"best\" bgcolor=\"#ffffff\" scale=\"noScale\" wmode=\"window\" salign=\"TL\"  FlashVars=\"playerMode=embedded\"> </embed>",
'<span style="text-align: center;"><p>Audio From: \1</p><embed type="application/x-shockwave-flash" src="http://www.google.com/reader/ui/3247397568-audio-player.swf?audioUrl=\\1" width="400" height="27" allowscriptaccess="never" quality="best" bgcolor="#ffffff" wmode="window" flashvars="playerMode=embedded" /></span>',
'<ol class="style" start="\1">\2</ol>',
'<ul class="style">\1</ul>',
'<li>\1</li>',
'<li>\1</li>',
'<hr />');
$s = preg_replace($bb_code_in, $bb_code_out, $s);
if ($urls) $s = format_urls($s);
    if (stripos($s, '[url') !== false && $urls) {
        $s = preg_replace_callback("/\[url=([^()<>\s]+?)\](.+?)\[\/url\]/is", "islocal", $s);
        // [url]http://www.example.com[/url]
        $s = preg_replace_callback("/\[url\]([^()<>\s]+?)\[\/url\]/is", "islocal", $s);
    }


if anyone needs this :)

Black

i look V3 but i cant fix this ... can u help me ?

Mindless

The preg pattern has a issue, that's bad escaping on quotes you see no doubt, so pattern must be fucked, no to sure what was changed but see v3 for code that's updated.

Black


BACDAFUCUP

i have the same problem...

Black

I use a version of the V2, and I have a problem with the links.



Error appears on the forum, torrents description, chat/shoutbox ... Does anyone have any idea how to fix it