Ignore:
Timestamp:
03/29/10 15:37:29 (2 years ago)
Author:
bogdan2412
Message:

Updated with changes from live.

  • Updated SMF to 1.1.11
  • Added Summify to site and forum
  • Small change to job detail view
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/smf/Sources/Subs.php

    r1048 r1121  
    66* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com)                    * 
    77* =============================================================================== * 
    8 * Software Version:           SMF 1.1.9                                           * 
     8* Software Version:           SMF 1.1.11                                          * 
    99* Software by:                Simple Machines (http://www.simplemachines.org)     * 
    1010* Copyright 2006-2009 by:     Simple Machines LLC (http://www.simplemachines.org) * 
     
    12351235                                'type' => 'unparsed_content', 
    12361236                                'content' => '<a href="$1" target="_blank">$1</a>', 
    1237                                 'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'), 
     1237                                'validate' => create_function('&$tag, &$data, $disabled', ' 
     1238                                        $data = strtr($data, array(\'<br />\' => \'\')); 
     1239                                        if (strpos($data, \'ftp://\') !== 0 && strpos($data, \'ftps://\') !== 0) 
     1240                                                $data = \'ftp://\' . $data; 
     1241                                '), 
    12381242                        ), 
    12391243                        array( 
     
    12421246                                'before' => '<a href="$1" target="_blank">', 
    12431247                                'after' => '</a>', 
     1248                                'validate' => create_function('&$tag, &$data, $disabled', ' 
     1249                                        if (strpos($data, \'ftp://\') !== 0 && strpos($data, \'ftps://\') !== 0) 
     1250                                                $data = \'ftp://\' . $data; 
     1251                                '), 
    12441252                                'disallow_children' => array('email', 'ftp', 'url', 'iurl'), 
    12451253                                'disabled_after' => ' ($1)', 
     
    12591267                                'validate' => create_function('&$tag, &$data, $disabled', ' 
    12601268                                        if (isset($disabled[\'url\'])) 
    1261                                                 $tag[\'content\'] = \'$1\';'), 
     1269                                                $tag[\'content\'] = \'$1\'; 
     1270                                        elseif (strpos($data[0], \'http://\') !== 0 && strpos($data[0], \'https://\') !== 0) 
     1271                                                $data[0] = \'http://\' . $data[0]; 
     1272                                '), 
    12621273                                'disabled_content' => '<a href="$1" target="_blank">$1</a>', 
    12631274                        ), 
     
    12961307                                ), 
    12971308                                'content' => '<img src="$1" alt="{alt}"{width}{height} border="0" />', 
    1298                                 'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'), 
     1309                                'validate' => create_function('&$tag, &$data, $disabled', ' 
     1310                                        $data = strtr($data, array(\'<br />\' => \'\')); 
     1311                                        if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0) 
     1312                                                $data = \'http://\' . $data; 
     1313                                '), 
    12991314                                'disabled_content' => '($1)', 
    13001315                        ), 
     
    13031318                                'type' => 'unparsed_content', 
    13041319                                'content' => '<img src="$1" alt="" border="0" />', 
    1305                                 'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'), 
     1320                                'validate' => create_function('&$tag, &$data, $disabled', ' 
     1321                                        $data = strtr($data, array(\'<br />\' => \'\')); 
     1322                                        if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0) 
     1323                                                $data = \'http://\' . $data; 
     1324                                '), 
    13061325                                'disabled_content' => '($1)', 
    13071326                        ), 
     
    13151334                                'type' => 'unparsed_content', 
    13161335                                'content' => '<a href="$1">$1</a>', 
    1317                                 'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'), 
     1336                                'validate' => create_function('&$tag, &$data, $disabled', ' 
     1337                                        $data = strtr($data, array(\'<br />\' => \'\')); 
     1338                                        if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0) 
     1339                                                $data = \'http://\' . $data; 
     1340                                '), 
    13181341                        ), 
    13191342                        array( 
     
    13241347                                'validate' => create_function('&$tag, &$data, $disabled', ' 
    13251348                                        if (substr($data, 0, 1) == \'#\') 
    1326                                                 $data = \'#post_\' . substr($data, 1);'), 
     1349                                                $data = \'#post_\' . substr($data, 1); 
     1350                                        elseif (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0) 
     1351                                                $data = \'http://\' . $data; 
     1352                                '), 
    13271353                                'disallow_children' => array('email', 'ftp', 'url', 'iurl'), 
    13281354                                'disabled_after' => ' ($1)', 
     
    15771603                                'type' => 'unparsed_content', 
    15781604                                'content' => '<a href="$1" target="_blank">$1</a>', 
    1579                                 'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'), 
     1605                                'validate' => create_function('&$tag, &$data, $disabled', ' 
     1606                                        $data = strtr($data, array(\'<br />\' => \'\')); 
     1607                                        if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0) 
     1608                                                $data = \'http://\' . $data; 
     1609                                '), 
    15801610                        ), 
    15811611                        array( 
     
    15841614                                'before' => '<a href="$1" target="_blank">', 
    15851615                                'after' => '</a>', 
     1616                                'validate' => create_function('&$tag, &$data, $disabled', ' 
     1617                                        if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0) 
     1618                                                $data = \'http://\' . $data; 
     1619                                '), 
    15861620                                'disallow_children' => array('email', 'ftp', 'url', 'iurl'), 
    15871621                                'disabled_after' => ' ($1)', 
     
    17191753                        if (!empty($modSettings['enablePostHTML']) && strpos($data, '&lt;') !== false) 
    17201754                        { 
    1721                                 $data = preg_replace('~&lt;a\s+href=(?:&quot;)?((?:http://|ftp://|https://|ftps://|mailto:).+?)(?:&quot;)?&gt;~i', '[url=$1]', $data); 
     1755                                $data = preg_replace('~&lt;a\s+href=((?:&quot;)?)((?:https?://|ftps?://|mailto:)\S+?)\\1&gt;~i', '[url=$2]', $data); 
    17221756                                $data = preg_replace('~&lt;/a&gt;~i', '[/url]', $data); 
    17231757 
     
    17391773 
    17401774                                // Do <img ... /> - with security... action= -> action-. 
    1741                                 preg_match_all('~&lt;img\s+src=(?:&quot;)?((?:http://|ftp://|https://|ftps://).+?)(?:&quot;)?(?:\s+alt=(?:&quot;)?(.*?)(?:&quot;)?)?(?:\s?/)?&gt;~i', $data, $matches, PREG_PATTERN_ORDER); 
     1775                                preg_match_all('~&lt;img\s+src=((?:&quot;)?)((?:https?://|ftps?://)\S+?)\\1(?:\s+alt=(&quot;.*?&quot;|\S*?))?(?:\s?/)?&gt;~i', $data, $matches, PREG_PATTERN_ORDER); 
    17421776                                if (!empty($matches[0])) 
    17431777                                { 
    17441778                                        $replaces = array(); 
    1745                                         foreach ($matches[1] as $match => $imgtag) 
     1779                                        foreach ($matches[2] as $match => $imgtag) 
    17461780                                        { 
    1747                                                 // No alt? 
    1748                                                 if (!isset($matches[2][$match])) 
    1749                                                         $matches[2][$match] = ''; 
     1781                                                $alt = empty($matches[3][$match]) ? '' : ' alt=' . preg_replace('~^&quot;|&quot;$~', '', $matches[3][$match]); 
    17501782 
    17511783                                                // Remove action= from the URL - no funny business, now. 
     
    17711803 
    17721804                                                        // Set the new image tag. 
    1773                                                         $replaces[$matches[0][$match]] = '<img src="' . $imgtag . '" width="' . $width . '" height="' . $height . '" alt="' . $matches[2][$match] . '" border="0" />'; 
     1805                                                        $replaces[$matches[0][$match]] = '[img width=' . $width . ' height=' . $height . $alt . ']' . $imgtag . '[/img]'; 
    17741806                                                } 
    17751807                                                else 
    1776                                                         $replaces[$matches[0][$match]] = '<img src="' . $imgtag . '" alt="' . $matches[2][$match] . '" border="0" />'; 
     1808                                                        $replaces[$matches[0][$match]] = '[img' . $alt . ']' . $imgtag . '[/img]'; 
    17771809                                        } 
    17781810 
     
    18061838                                                // Switch out quotes really quick because they can cause problems. 
    18071839                                                $data = strtr($data, array('&#039;' => '\'', '&nbsp;' => $context['utf8'] ? "\xC2\xA0" : "\xA0", '&quot;' => '>">', '"' => '<"<', '&lt;' => '<lt<')); 
    1808                                                 $data = preg_replace(array('~(?<=[\s>\.(;\'"]|^)((?:http|https|ftp|ftps)://[\w\-_%@:|]+(?:\.[\w\-_%]+)*(?::\d+)?(?:/[\w\-_\~%\.@,\?&;=#+:\'\\\\]*|[\(\{][\w\-_\~%\.@,\?&;=#(){}+:\'\\\\]*)*[/\w\-_\~%@\?;=#}\\\\])~i', '~(?<=[\s>(\'<]|^)(www(?:\.[\w\-_]+)+(?::\d+)?(?:/[\w\-_\~%\.@,\?&;=#+:\'\\\\]*|[\(\{][\w\-_\~%\.@,\?&;=#(){}+:\'\\\\]*)*[/\w\-_\~%@\?;=#}\\\\])~i'), array('[url]$1[/url]', '[url=http://$1]$1[/url]'), $data); 
     1840 
     1841                                                // Only do this if the preg survives. 
     1842                                                if (is_string($result = preg_replace(array( 
     1843                                                        '~(?<=[\s>\.(;\'"]|^)((?:http|https|ftp|ftps)://[\w\-_%@:|]+(?:\.[\w\-_%]+)*(?::\d+)?(?:/[\w\-_\~%\.@,\?&;=#(){}+:\'\\\\]*)*[/\w\-_\~%@\?;=#}\\\\])~i',  
     1844                                                        '~(?<=[\s>(\'<]|^)(www(?:\.[\w\-_]+)+(?::\d+)?(?:/[\w\-_\~%\.@,\?&;=#(){}+:\'\\\\]*)*[/\w\-_\~%@\?;=#}\\\\])~i' 
     1845                                                ), array( 
     1846                                                        '[url]$1[/url]', 
     1847                                                        '[url=http://$1]$1[/url]' 
     1848                                                ), $data))) 
     1849                                                        $data = $result; 
     1850 
    18091851                                                $data = strtr($data, array('\'' => '&#039;', $context['utf8'] ? "\xC2\xA0" : "\xA0" => '&nbsp;', '>">' => '&quot;', '<"<' => '"', '<lt<' => '&lt;')); 
    18101852                                        } 
     
    24372479                        $smileyfromcache[] = '/(?<=[>:\?\.\s' . $non_breaking_space . '[\]()*\\\;]|^)(' . preg_quote($smileysfrom[$i], '/') . '|' . preg_quote(htmlspecialchars($smileysfrom[$i], ENT_QUOTES), '/') . ')(?=[^[:alpha:]0-9]|$)/' . ($context['utf8'] ? 'u' : ''); 
    24382480                        // Escape a bunch of smiley-related characters in the description so it doesn't get a double dose :P. 
    2439                         $smileytocache[] = '<img src="' . $modSettings['smileys_url'] . '/' . $user_info['smiley_set'] . '/' . $smileysto[$i] . '" alt="' . strtr(htmlspecialchars($smileysdescs[$i]), array(':' => '&#58;', '(' => '&#40;', ')' => '&#41;', '$' => '&#36;', '[' => '&#091;')) . '" border="0" />'; 
     2481                        $smileytocache[] = '<img src="' . htmlspecialchars($modSettings['smileys_url'] . '/' . $user_info['smiley_set'] . '/' . $smileysto[$i]) . '" alt="' . strtr(htmlspecialchars($smileysdescs[$i]), array(':' => '&#58;', '(' => '&#40;', ')' => '&#41;', '$' => '&#36;', '[' => '&#091;')) . '" border="0" />'; 
    24402482                } 
    24412483        } 
Note: See TracChangeset for help on using the changeset viewer.