Changeset 1121


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
Location:
trunk
Files:
36 edited

Legend:

Unmodified
Added
Removed
  • trunk/scripts/db-backup-delete

    r1113 r1121  
    1313 
    1414// Important: Set the first date when the script will be run. 
    15 define('START', mktime(0, 0, 0, 3, 19, 2010)); 
     15define('START', mktime(0, 0, 0, 3, 21, 2010)); 
    1616 
    1717 
  • trunk/smf/Packages/installed.list

    r1048 r1121  
    1 Visual Verification Options|^|VisualVerificationOptions_0-5-2.tar.gz|^|motokochan:visualverificationoptions|^|0.5.2 
  • trunk/smf/Settings.php

    r852 r1121  
    1515// Webmaster email (e-mail where it sends reports in case shit) 
    1616// Also serves as address to send emails from 
    17 $webmaster_email = 'strat.cristian@gmail.com'; 
     17$webmaster_email = 'no-reply@infoarena.ro'; 
    1818 
    1919// Decent defaults below (edit only if you get bored) 
  • trunk/smf/Sources/BoardIndex.php

    r852 r1121  
    66* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com)                    * 
    77* =============================================================================== * 
    8 * Software Version:           SMF 1.1                                             * 
     8* Software Version:           SMF 1.1.11                                          * 
    99* Software by:                Simple Machines (http://www.simplemachines.org)     * 
    10 * Copyright 2006 by:          Simple Machines LLC (http://www.simplemachines.org) * 
     10* Copyright 2006-2009 by:     Simple Machines LLC (http://www.simplemachines.org) * 
    1111*           2001-2006 by:     Lewis Media (http://www.lewismedia.com)             * 
    1212* Support, News, Updates at:  http://www.simplemachines.org                       * 
     
    9696                                'is_collapsed' => isset($row_board['canCollapse']) && $row_board['canCollapse'] == 1 && $row_board['isCollapsed'] > 0, 
    9797                                'can_collapse' => isset($row_board['canCollapse']) && $row_board['canCollapse'] == 1, 
    98                                 'collapse_href' => isset($row_board['canCollapse']) ? $scripturl . '?action=collapse;c=' . $row_board['ID_CAT'] . ';sa=' . ($row_board['isCollapsed'] > 0 ? 'expand' : 'collapse;') . '#' . $row_board['ID_CAT'] : '', 
     98                                'collapse_href' => isset($row_board['canCollapse']) ? $scripturl . '?action=collapse;c=' . $row_board['ID_CAT'] . ';sa=' . ($row_board['isCollapsed'] > 0 ? 'expand' : 'collapse') . ';sesc=' . $context['session_id'] . '#' . $row_board['ID_CAT'] : '', 
    9999                                'collapse_image' => isset($row_board['canCollapse']) ? '<img src="' . $settings['images_url'] . '/' . ($row_board['isCollapsed'] > 0 ? 'expand.gif" alt="+"' : 'collapse.gif" alt="-"') . ' border="0" />' : '', 
    100100                                'href' => $scripturl . '#' . $row_board['ID_CAT'], 
  • trunk/smf/Sources/Display.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) * 
     
    929929function Download() 
    930930{ 
    931         global $txt, $modSettings, $db_prefix, $user_info, $scripturl, $context, $sourcedir; 
     931        global $txt, $modSettings, $db_prefix, $user_info, $scripturl, $context, $sourcedir, $topic; 
    932932 
    933933        $context['no_last_modified'] = true; 
     
    952952        else 
    953953        { 
     954                // This checks only the current board for $board/$topic's permissions. 
    954955                isAllowedTo('view_attachments'); 
    955956 
    956957                // Make sure this attachment is on this board. 
     958                // NOTE: We must verify that $topic is the attachment's topic, or else the permission check above is broken. 
    957959                $request = db_query(" 
    958960                        SELECT a.filename, a.ID_ATTACH, a.attachmentType, a.file_hash 
     
    961963                                AND $user_info[query_see_board] 
    962964                                AND m.ID_MSG = a.ID_MSG 
     965                                AND m.ID_TOPIC = $topic 
    963966                                AND a.ID_ATTACH = $_REQUEST[attach] 
    964967                        LIMIT 1", __FILE__, __LINE__); 
  • trunk/smf/Sources/Load.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) * 
     
    13661366        $context['browser']['needs_size_fix'] = ($context['browser']['is_ie5'] || $context['browser']['is_ie5.5'] || $context['browser']['is_ie4'] || $context['browser']['is_opera6']) && strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') === false; 
    13671367 
     1368        // 1.1.x doesn't detect IE8, so render as IE7. 
     1369        $context['html_headers'] .= '<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />'; 
     1370 
    13681371        // This isn't meant to be reliable, it's just meant to catch most bots to prevent PHPSESSID from showing up. 
    13691372        $ci_user_agent = strtolower($_SERVER['HTTP_USER_AGENT']); 
     
    19141917{ 
    19151918        global $sc; 
     1919        global $HTTP_SESSION_VARS, $modSettings, $boardurl; 
    19161920 
    19171921        // Most of this was commented for [infoarena] integration. 
  • trunk/smf/Sources/ManageAttachments.php

    r1048 r1121  
    66* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com)                    * 
    77* =============================================================================== * 
    8 * Software Version:           SMF 1.1.10                                          * 
     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) * 
     
    339339                                'downloads' => $row['downloads'], 
    340340                                'href' => $row['attachmentType'] == 1 ? $modSettings['custom_avatar_url'] . '/' . $row['filename'] : ($scripturl . '?action=dlattach;' . ($context['browse_type'] == 'avatars' ? 'type=avatar;' : 'topic=' . $row['ID_TOPIC'] . '.0;') . 'id=' . $row['ID_ATTACH']), 
    341                                 'link' => '<a href="' . ($row['attachmentType'] == 1 ? $modSettings['custom_avatar_url'] . '/' . $row['filename'] : ($scripturl . '?action=dlattach;' . ($context['browse_type'] == 'avatars' ? 'type=avatar;' : 'topic=' . $row['ID_TOPIC'] . '.0;') . 'id=' . $row['ID_ATTACH'])) . '"' . (empty($row['width']) || empty($row['height']) ? '' : ' onclick="return reqWin(this.href + \'' . ($modSettings['custom_avatar_url'] ? '' : ';image') . '\', ' . ($row['width'] + 20) . ', ' . ($row['height'] + 20) . ', true);"') . '>' . htmlspecialchars($row['filename']) . '</a>' 
     341                                'link' => '<a href="' . ($row['attachmentType'] == 1 ? $modSettings['custom_avatar_url'] . '/' . $row['filename'] : ($scripturl . '?action=dlattach;' . ($context['browse_type'] == 'avatars' ? 'type=avatar;' : 'topic=' . $row['ID_TOPIC'] . '.0;') . 'id=' . $row['ID_ATTACH'])) . '"' . (empty($row['width']) || empty($row['height']) ? '' : ' onclick="return reqWin(this.href + \'' . ($row['attachmentType'] == 1 ? '' : ';image') . '\', ' . ($row['width'] + 20) . ', ' . ($row['height'] + 20) . ', true);"') . '>' . htmlspecialchars($row['filename']) . '</a>' 
    342342                        ), 
    343343                        'topic' => $row['ID_TOPIC'], 
     
    562562                SELECT 
    563563                        a.filename, a.file_hash, a.attachmentType, a.ID_ATTACH, a.ID_MEMBER" . ($query_type == 'messages' ? ', m.ID_MSG' : ', a.ID_MSG') . ", 
    564                         IFNULL(thumb.ID_ATTACH, 0) AS ID_THUMB, thumb.filename AS thumb_filename, thumb_parent.ID_ATTACH AS ID_PARENT 
     564                        IFNULL(thumb.ID_ATTACH, 0) AS ID_THUMB, thumb.filename AS thumb_filename, thumb_parent.ID_ATTACH AS ID_PARENT, 
     565                        thumb.file_hash as thumb_file_hash 
    565566                FROM ({$db_prefix}attachments AS a" .($query_type == 'members' ? ", {$db_prefix}members AS mem" : ($query_type == 'messages' ? ", {$db_prefix}messages AS m" : '')) . ") 
    566567                        LEFT JOIN {$db_prefix}attachments AS thumb ON (thumb.ID_ATTACH = a.ID_THUMB) 
     
    586587                        if (!empty($row['ID_THUMB']) && $autoThumbRemoval) 
    587588                        { 
    588                                 $thumb_filename = getAttachmentFilename($row['thumb_filename'], $row['ID_THUMB'], false, $row['file_hash']); 
     589                                $thumb_filename = getAttachmentFilename($row['thumb_filename'], $row['ID_THUMB'], false, $row['thumb_file_hash']); 
    589590                                @unlink($thumb_filename); 
    590591                                $attach[] = $row['ID_THUMB']; 
  • trunk/smf/Sources/ManageCalendar.php

    r852 r1121  
    66* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com)                    * 
    77* =============================================================================== * 
    8 * Software Version:           SMF 1.1                                             * 
     8* Software Version:           SMF 1.1.11                                          * 
    99* Software by:                Simple Machines (http://www.simplemachines.org)     * 
    10 * Copyright 2006 by:          Simple Machines LLC (http://www.simplemachines.org) * 
     10* Copyright 2006-2009 by:     Simple Machines LLC (http://www.simplemachines.org) * 
    1111*           2001-2006 by:     Lewis Media (http://www.lewismedia.com)             * 
    1212* Support, News, Updates at:  http://www.simplemachines.org                       * 
     
    144144        $context['sub_template'] = 'edit_holiday'; 
    145145        $context['admin_tabs']['tabs']['holidays']['is_selected'] = true; 
     146         
     147        // Cast this for safety... 
     148        if (isset($_REQUEST['holiday'])) 
     149                $_REQUEST['holiday'] = (int) $_REQUEST['holiday']; 
    146150 
    147151        // Submitting? 
  • trunk/smf/Sources/ManageMembers.php

    r1048 r1121  
    66* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com)                    * 
    77* =============================================================================== * 
    8 * Software Version:           SMF 1.1.6                                           * 
     8* Software Version:           SMF 1.1.11                                          * 
    99* Software by:                Simple Machines (http://www.simplemachines.org)     * 
    10 * Copyright 2006 by:          Simple Machines LLC (http://www.simplemachines.org) * 
     10* Copyright 2006-2009 by:     Simple Machines LLC (http://www.simplemachines.org) * 
    1111*           2001-2006 by:     Lewis Media (http://www.lewismedia.com)             * 
    1212* Support, News, Updates at:  http://www.simplemachines.org                       * 
     
    202202        } 
    203203 
     204        // Build a search for a specific group or post group. 
     205        if ($context['sub_action'] === 'query') 
     206        { 
     207                if (isset($_GET['group'])) 
     208                        $_POST['membergroups'] = array( 
     209                                array((int) $_GET['group']), 
     210                                array((int) $_GET['group']), 
     211                        ); 
     212                elseif (isset($_GET['pgroup'])) 
     213                        $_POST['postgroups'] = array((int) $_GET['pgroup']); 
     214        } 
     215 
     216        if ($context['sub_action'] == 'query' && !empty($_REQUEST['params']) && empty($_POST)) 
     217        { 
     218                $search_params = base64_decode(stripslashes($_REQUEST['params'])); 
     219                $_POST += addslashes__recursive(@unserialize($search_params)); 
     220        } 
     221 
    204222        // Check input after a member search has been submitted. 
    205         if ($context['sub_action'] == 'query' && empty($_REQUEST['params'])) 
     223        if ($context['sub_action'] == 'query') 
    206224        { 
    207225                // Retrieving the membergroups and postgroups. 
     
    399417                $where = empty($query_parts) ? '1' : implode(' 
    400418                        AND ', $query_parts); 
    401         } 
    402         // If the query information was already packed in the URL, decode it. 
    403         // !!! Change this. 
    404         elseif ($context['sub_action'] == 'query') 
    405                 $where = base64_decode(strtr($_REQUEST['params'], array(' ' => '+'))); 
     419 
     420                $search_params = base64_encode(serialize(stripslashes__recursive($_POST))); 
     421        } 
     422        else 
     423                $search_params = null; 
    406424 
    407425        // Construct the additional URL part with the query info in it. 
    408         $context['params_url'] = $context['sub_action'] == 'query' ? ';sa=query;params=' . base64_encode($where) : ''; 
     426        $context['params_url'] = $context['sub_action'] == 'query' ? ';sa=query;params=' . $search_params : ''; 
    409427 
    410428        // Get the title and sub template ready.. 
  • trunk/smf/Sources/ManagePermissions.php

    r1017 r1121  
    66* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com)                    * 
    77* =============================================================================== * 
    8 * Software Version:           SMF 1.1.5                                           * 
     8* Software Version:           SMF 1.1.11                                          * 
    99* Software by:                Simple Machines (http://www.simplemachines.org)     * 
    10 * Copyright 2006-2007 by:     Simple Machines LLC (http://www.simplemachines.org) * 
     10* Copyright 2006-2009 by:     Simple Machines LLC (http://www.simplemachines.org) * 
    1111*           2001-2006 by:     Lewis Media (http://www.lewismedia.com)             * 
    1212* Support, News, Updates at:  http://www.simplemachines.org                       * 
     
    190190                        'allow_modify' => true, 
    191191                        'can_search' => true, 
    192                         'href' => $scripturl . '?action=viewmembers;sa=query;params=' . base64_encode('ID_GROUP = 0'), 
     192                        'href' => $scripturl . '?action=viewmembers;sa=query;group=0', 
    193193                        'is_post_group' => false, 
    194194                        'color' => '', 
     
    221221                        'allow_modify' => $row['ID_GROUP'] > 1, 
    222222                        'can_search' => $row['ID_GROUP'] != 3, 
    223                         'href' => $scripturl . '?action=viewmembers;sa=query;params=' . base64_encode($row['minPosts'] == -1 ? "ID_GROUP = $row[ID_GROUP] OR FIND_IN_SET($row[ID_GROUP], additionalGroups)" : "ID_POST_GROUP = $row[ID_GROUP]"), 
     223                        'href' => $scripturl . '?action=viewmembers;sa=query' . ($row['minPosts'] == -1 ? ';group=' . (int) $row['ID_GROUP'] : ';pgroup=' . (int) $row['ID_GROUP']), 
    224224                        'is_post_group' => $row['minPosts'] != -1, 
    225225                        'color' => empty($row['onlineColor']) ? '' : $row['onlineColor'], 
  • trunk/smf/Sources/ManagePosts.php

    r1017 r1121  
    276276                        'enableEmbeddedFlash' => empty($_POST['enableEmbeddedFlash']) ? '0' : '1', 
    277277                        'enableSpellChecking' => empty($_POST['enableSpellChecking']) ? '0' : '1', 
    278  
    279                         'visual_verification_guest_post' => empty($_POST['visual_verification_guest_post']) ? '0' : '1', 
    280278                        'max_messageLength' => empty($_POST['max_messageLength']) ? '0' : (int) $_POST['max_messageLength'], 
    281279                        'fixLongWords' => empty($_POST['fixLongWords']) ? '0' : (int) $_POST['fixLongWords'], 
  • trunk/smf/Sources/ManageSearch.php

    r1017 r1121  
    144144                updateSettings(array( 
    145145                        'simpleSearch' => isset($_POST['simpleSearch']) ? '1' : '0', 
    146  
    147                         'visual_verification_guest_search' => isset($_POST['visual_verification_guest_search']) ? '1' : '0', 
    148146                        'search_results_per_page' => (int) $_POST['search_results_per_page'], 
    149147                        'search_max_results' => (int) $_POST['search_max_results'], 
  • trunk/smf/Sources/ManageSmileys.php

    r852 r1121  
    66* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com)                    * 
    77* =============================================================================== * 
    8 * Software Version:           SMF 1.1.1                                           * 
     8* Software Version:           SMF 1.1.11                                          * 
    99* Software by:                Simple Machines (http://www.simplemachines.org)     * 
    10 * Copyright 2006 by:          Simple Machines LLC (http://www.simplemachines.org) * 
     10* Copyright 2006-2009 by:     Simple Machines LLC (http://www.simplemachines.org) * 
    1111*           2001-2006 by:     Lewis Media (http://www.lewismedia.com)             * 
    1212* Support, News, Updates at:  http://www.simplemachines.org                       * 
     
    175175                $context['smiley_sets'][$i] = array( 
    176176                        'id' => $i, 
    177                         'path' => $set, 
    178                         'name' => $set_names[$i], 
     177                        'path' => htmlspecialchars($set), 
     178                        'name' => htmlspecialchars($set_names[$i]), 
    179179                        'selected' => $set == $modSettings['smiley_sets_default'] 
    180180                ); 
     
    267267                $context['smiley_sets'][$i] = array( 
    268268                        'id' => $i, 
    269                         'path' => $set, 
    270                         'name' => $set_names[$i], 
     269                        'path' => htmlspecialchars($set), 
     270                        'name' => htmlspecialchars($set_names[$i]), 
    271271                        'selected' => $set == $modSettings['smiley_sets_default'] 
    272272                ); 
     
    280280                // Sanity check - then import. 
    281281                if (isset($context['smiley_sets'][$_GET['set']])) 
    282                         ImportSmileys($context['smiley_sets'][$_GET['set']]['path']); 
     282                        ImportSmileys(un_htmlspecialchars($context['smiley_sets'][$_GET['set']]['path'])); 
    283283 
    284284                // Force the process to continue. 
     
    362362                $context['smiley_sets'][$i] = array( 
    363363                        'id' => $i, 
    364                         'path' => $set, 
    365                         'name' => $set_names[$i], 
     364                        'path' => htmlspecialchars($set), 
     365                        'name' => htmlspecialchars($set_names[$i]), 
    366366                        'selected' => $set == $modSettings['smiley_sets_default'] 
    367367                ); 
     
    399399                        foreach ($context['smiley_sets'] as $set) 
    400400                        { 
    401                                 if (!is_writable($context['smileys_dir'] . '/' . $set['path'])) 
     401                                if (!is_writable($context['smileys_dir'] . '/' . un_htmlspecialchars($set['path']))) 
    402402                                        $writeErrors[] = $set['path']; 
    403403                        } 
     
    429429                        $i = 0; 
    430430                        // Keep going until we find a set the file doesn't exist in. (or maybe it exists in all of them?) 
    431                         while (isset($context['smiley_sets'][$i]) && file_exists($context['smileys_dir'] . '/' . $context['smiley_sets'][$i]['path'] . '/' . $destName)) 
     431                        while (isset($context['smiley_sets'][$i]) && file_exists($context['smileys_dir'] . '/' . un_htmlspecialchars($context['smiley_sets'][$i]['path']) . '/' . $destName)) 
    432432                                $i++; 
    433433 
     
    435435                        if (isset($context['smiley_sets'][$i]['path'])) 
    436436                        { 
    437                                 $smileyLocation = $context['smileys_dir'] . '/' . $context['smiley_sets'][$i]['path'] . '/' . $destName; 
     437                                $smileyLocation = $context['smileys_dir'] . '/' . un_htmlspecialchars($context['smiley_sets'][$i]['path']) . '/' . $destName; 
    438438                                move_uploaded_file($_FILES['uploadSmiley']['tmp_name'], $smileyLocation); 
    439439                                @chmod($smileyLocation, 0644); 
     
    442442                                for ($n = count($context['smiley_sets']); $i < $n; $i++) 
    443443                                { 
    444                                         $currentPath = $context['smileys_dir'] . '/' . $context['smiley_sets'][$i]['path'] . '/' . $destName; 
     444                                        $currentPath = $context['smileys_dir'] . '/' . un_htmlspecialchars($context['smiley_sets'][$i]['path']) . '/' . $destName; 
    445445 
    446446                                        // The file is already there!  Don't overwrite it! 
     
    473473                        foreach ($context['smiley_sets'] as $i => $set) 
    474474                        { 
     475                                $set['name'] = un_htmlspecialchars($set['name']); 
     476                                $set['path'] = un_htmlspecialchars($set['path']); 
     477 
    475478                                if (!isset($_FILES['individual_' . $set['name']]['name']) || $_FILES['individual_' . $set['name']]['name'] == '') 
    476479                                        continue; 
     
    547550                foreach ($context['smiley_sets'] as $smiley_set) 
    548551                { 
    549                         if (!file_exists($context['smileys_dir'] . '/' . $smiley_set['path'])) 
     552                        if (!file_exists($context['smileys_dir'] . '/' . un_htmlspecialchars($smiley_set['path']))) 
    550553                                continue; 
    551554 
    552                         $dir = dir($context['smileys_dir'] . '/' . $smiley_set['path']); 
     555                        $dir = dir($context['smileys_dir'] . '/' . un_htmlspecialchars($smiley_set['path'])); 
    553556                        while ($entry = $dir->read()) 
    554557                        { 
     
    665668                $context['smiley_sets'][$i] = array( 
    666669                        'id' => $i, 
    667                         'path' => $set, 
    668                         'name' => $set_names[$i], 
     670                        'path' => htmlspecialchars($set), 
     671                        'name' => htmlspecialchars($set_names[$i]), 
    669672                        'selected' => $set == $modSettings['smiley_sets_default'] 
    670673                ); 
     
    706709                        { 
    707710                                foreach ($context['smileys'] as $smiley_id => $smiley) 
    708                                         if (!file_exists($modSettings['smileys_dir'] . '/' . $smiley_set['path'] . '/' . $smiley['filename'])) 
     711                                        if (!file_exists($modSettings['smileys_dir'] . '/' . un_htmlspecialchars($smiley_set['path']) . '/' . $smiley['filename'])) 
    709712                                                $context['smileys'][$smiley_id]['sets_not_found'][] = $smiley_set['path']; 
    710713                        } 
     
    724727                        $context['smiley_sets'][$i] = array( 
    725728                                'id' => $i, 
    726                                 'path' => $set, 
    727                                 'name' => $set_names[$i], 
     729                                'path' => htmlspecialchars($set), 
     730                                'name' => htmlspecialchars($set_names[$i]), 
    728731                                'selected' => $set == $modSettings['smiley_sets_default'] 
    729732                        ); 
     
    737740                        foreach ($context['smiley_sets'] as $smiley_set) 
    738741                        { 
    739                                 if (!file_exists($context['smileys_dir'] . '/' . $smiley_set['path'])) 
     742                                if (!file_exists($context['smileys_dir'] . '/' . un_htmlspecialchars($smiley_set['path']))) 
    740743                                        continue; 
    741744 
    742                                 $dir = dir($context['smileys_dir'] . '/' . $smiley_set['path']); 
     745                                $dir = dir($context['smileys_dir'] . '/' . un_htmlspecialchars($smiley_set['path'])); 
    743746                                while ($entry = $dir->read()) 
    744747                                { 
  • trunk/smf/Sources/Modlog.php

    r852 r1121  
    66* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com)                    * 
    77* =============================================================================== * 
    8 * Software Version:           SMF 1.1                                             * 
     8* Software Version:           SMF 1.1.11                                          * 
    99* Software by:                Simple Machines (http://www.simplemachines.org)     * 
    10 * Copyright 2006 by:          Simple Machines LLC (http://www.simplemachines.org) * 
     10* Copyright 2006-2009 by:     Simple Machines LLC (http://www.simplemachines.org) * 
    1111*           2001-2006 by:     Lewis Media (http://www.lewismedia.com)             * 
    1212* Support, News, Updates at:  http://www.simplemachines.org                       * 
     
    9393        } 
    9494 
    95         // If we have no search, a broken search, or a new search - then create a new array. 
     95        // This array houses all the valid search types. 
     96        $searchTypes = array( 
     97                'action' => array('sql' => 'lm.action', 'label' => $txt['modlog_action']), 
     98                'member' => array('sql' => 'mem.realName', 'label' => $txt['modlog_member']), 
     99                'group' => array('sql' => 'mg.groupName', 'label' => $txt['modlog_position']), 
     100                'ip' => array('sql' => 'lm.ip', 'label' => $txt['modlog_ip']) 
     101        ); 
     102 
    96103        if (!isset($search_params['string']) || (!empty($_REQUEST['search']) && $search_params['string'] != $_REQUEST['search'])) 
    97         { 
    98                 // This array houses all the valid search types. 
    99                 $searchTypes = array( 
    100                         'action' => array('sql' => 'lm.action', 'label' => $txt['modlog_action']), 
    101                         'member' => array('sql' => 'mem.realName', 'label' => $txt['modlog_member']), 
    102                         'group' => array('sql' => 'mg.groupName', 'label' => $txt['modlog_position']), 
    103                         'ip' => array('sql' => 'lm.ip', 'label' => $txt['modlog_ip']) 
    104                 ); 
    105  
    106                 $search_params = array( 
    107                         'string' => empty($_REQUEST['search']) ? '' : $_REQUEST['search'], 
    108                         'type' => isset($_REQUEST['search_type']) && isset($searchTypes[$_REQUEST['search_type']]) ? $_REQUEST['search_type'] : isset($searchTypes[$context['order']]) ? $context['order'] : 'member', 
    109                         'type_sql' => isset($_REQUEST['search_type']) && isset($searchTypes[$_REQUEST['search_type']]) ? $searchTypes[$_REQUEST['search_type']]['sql'] : isset($searchTypes[$context['order']]) ? $context['columns'][$context['order']]['sql'] : 'mem.realName', 
    110                         'type_label' => isset($_REQUEST['search_type']) && isset($searchTypes[$_REQUEST['search_type']]) ? $searchTypes[$_REQUEST['search_type']]['label'] : isset($searchTypes[$context['order']]) ? $context['columns'][$context['order']]['label'] : $txt['modlog_member'], 
    111                 ); 
    112         } 
     104                $search_params_string = empty($_REQUEST['search']) ? '' : $_REQUEST['search']; 
     105        else 
     106                $search_params_string = $search_params['string']; 
     107 
     108        if (isset($_REQUEST['search_type']) || empty($search_params['type']) || !isset($searchTypes[$search_params['type']])) 
     109                $search_params_type = isset($_REQUEST['search_type']) && isset($searchTypes[$_REQUEST['search_type']]) ? $_REQUEST['search_type'] : (isset($searchTypes[$context['order']]) ? $context['order'] : 'member'); 
     110        else 
     111                $search_params_type = $search_params['type']; 
     112 
     113        $search_params_column = $searchTypes[$search_params_type]['sql']; 
     114        $search_params = array( 
     115                'string' => $search_params_string, 
     116                'type' => $search_params_type, 
     117        ); 
    113118 
    114119        // Setup the search context. 
     
    117122                'string' => stripslashes($search_params['string']), 
    118123                'type' => $search_params['type'], 
    119                 'label' => $search_params['type_label'] 
     124                'label' => $searchTypes[$search_params_type]['label'], 
    120125        ); 
    121126 
     
    168173                        LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = lm.ID_MEMBER) 
    169174                        LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))" . (!empty($search_params['string']) ? " 
    170                 WHERE INSTR($search_params[type_sql], '$search_params[string]')" : ''), __FILE__, __LINE__); 
     175                WHERE INSTR($search_params_column, '$search_params[string]')" : ''), __FILE__, __LINE__); 
    171176        list ($context['entry_count']) = mysql_fetch_row($result); 
    172177        mysql_free_result($result); 
     
    184189                        LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = lm.ID_MEMBER) 
    185190                        LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))" . (!empty($search_params['string']) ? " 
    186                 WHERE INSTR($search_params[type_sql], '$search_params[string]')" : '') . " 
     191                WHERE INSTR($search_params_column, '$search_params[string]')" : '') . " 
    187192                ORDER BY $orderType" . (isset($_REQUEST['d']) ? '' : ' DESC') . " 
    188193                LIMIT $context[start], $displaypage", __FILE__, __LINE__); 
  • trunk/smf/Sources/PackageGet.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) * 
     
    140140        { 
    141141                $context['servers'][] = array( 
    142                         'name' => $row['name'], 
    143                         'url' => $row['url'], 
     142                        'name' => htmlspecialchars($row['name']), 
     143                        'url' => htmlspecialchars($row['url']), 
    144144                        'id' => $row['ID_SERVER'], 
    145145                ); 
     
    689689        global $db_prefix; 
    690690 
     691        checkSession('get'); 
     692 
    691693        db_query(" 
    692694                DELETE FROM {$db_prefix}package_servers 
  • trunk/smf/Sources/Packages.php

    r1048 r1121  
    66* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com)                    * 
    77* =============================================================================== * 
    8 * Software Version:           SMF 1.1.10                                          * 
     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) * 
     
    732732        if (!isset($_GET['package']) || $_GET['package'] == 'index.php' || $_GET['package'] == 'installed.list') 
    733733                redirectexit('action=packages;sa=browse'); 
    734         $_GET['package'] = preg_replace('~[\.]+~', '.', strtr($_GET['package'], '/', '_')); 
     734        $_GET['package'] = preg_replace('~[\.]+~', '.', strtr($_GET['package'], array('/' => '_', '\\' => '_'))); 
    735735 
    736736        // Can't delete what's not there. 
    737         if (file_exists($boarddir . '/Packages/' . $_GET['package'])) 
     737        if (file_exists($boarddir . '/Packages/' . $_GET['package']) && (substr($_GET['package'], -4) == '.zip' || substr($_GET['package'], -4) == '.tgz' || substr($_GET['package'], -7) == '.tar.gz' || is_dir($boarddir . '/Packages/' . $_GET['package'])) && $_GET['package'] != 'backups' && substr($_GET['package'], 0, 1) != '.') 
    738738        { 
    739739                packageRequireFTP($scripturl . '?action=packages;sa=remove;package=' . $_GET['package'], array($boarddir . '/Packages/' . $_GET['package'])); 
     
    910910        if (isset($_POST['submit'])) 
    911911        { 
     912                checkSession('post'); 
     913 
    912914                updateSettings(array( 
    913915                        'package_server' => $_POST['pack_server'], 
  • trunk/smf/Sources/Poll.php

    r852 r1121  
    66* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com)                    * 
    77* =============================================================================== * 
    8 * Software Version:           SMF 1.1                                             * 
     8* Software Version:           SMF 1.1.11                                          * 
    99* Software by:                Simple Machines (http://www.simplemachines.org)     * 
    10 * Copyright 2006 by:          Simple Machines LLC (http://www.simplemachines.org) * 
     10* Copyright 2006-2009 by:     Simple Machines LLC (http://www.simplemachines.org) * 
    1111*           2001-2006 by:     Lewis Media (http://www.lewismedia.com)             * 
    1212* Support, News, Updates at:  http://www.simplemachines.org                       * 
     
    116116        elseif (!empty($row['changeVote'])) 
    117117        { 
     118                checkSession('request'); 
    118119                $pollOptions = array(); 
    119120 
     
    697698                fatal_lang_error(1, false); 
    698699 
     700        checkSession('get'); 
     701 
    699702        // Check permissions. 
    700703        if (!allowedTo('poll_remove_any')) 
  • trunk/smf/Sources/Post.php

    r1048 r1121  
    66* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com)                    * 
    77* =============================================================================== * 
    8 * Software Version:           SMF 1.1.10                                          * 
     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) * 
     
    106106        // Posting an event? 
    107107        $context['make_event'] = isset($_REQUEST['calendar']); 
    108  
    109         // Generate a visual verification code to make sure the user is no bot. 
    110         $context['visual_verification'] = (empty($modSettings['disable_visual_verification']) || $modSettings['disable_visual_verification'] != 1) && ($user_info['is_guest'] && $modSettings['visual_verification_guest_post']); 
    111         if ($context['visual_verification']) 
    112         { 
    113                 loadLanguage('Login'); 
    114  
    115                 $context['use_graphic_library'] = in_array('gd', get_loaded_extensions()); 
    116                 $context['verificiation_image_href'] = $scripturl . '?action=verificationcode;rand=' . md5(rand()); 
    117  
    118                 // Only generate a new code if one hasn't been set yet 
    119                 if (!isset($_SESSION['visual_verification_code'])) 
    120                 { 
    121                         // Skip I, J, L, O and Q. 
    122                         $character_range = array_merge(range('A', 'H'), array('K', 'M', 'N', 'P'), range('R', 'Z')); 
    123  
    124                         // Generate a new code. 
    125                         $_SESSION['visual_verification_code'] = ''; 
    126                         for ($i = 0; $i < 5; $i++) 
    127                                 $_SESSION['visual_verification_code'] .= $character_range[array_rand($character_range)]; 
    128                 } 
    129         } 
    130  
    131108 
    132109        // You must be posting to *some* board. 
     
    637614                                                continue; 
    638615                                        $context['current_attachments'][] = array( 
    639                                                 'name' => $row['filename'], 
     616                                                'name' => htmlspecialchars($row['filename']), 
    640617                                                'id' => $row['ID_ATTACH'] 
    641618                                        ); 
     
    729706                        if ($attachment['filesize'] >= 0 && !empty($modSettings['attachmentEnable'])) 
    730707                                $context['current_attachments'][] = array( 
    731                                         'name' => $attachment['filename'], 
     708                                        'name' => htmlspecialchars($attachment['filename']), 
    732709                                        'id' => $attachment['ID_ATTACH'] 
    733710                                ); 
     
    14151392                $_POST['email'] = addslashes($user_info['email']); 
    14161393        } 
    1417  
    1418         // Check whether the visual verification code was entered correctly. 
    1419         if ((empty($modSettings['disable_visual_verification']) || $modSettings['disable_visual_verification'] != 1) && ($user_info['is_guest'] && $modSettings['visual_verification_guest_post'])) 
    1420         { 
    1421                 if ((empty($_REQUEST['visual_verification_code']) || strtoupper($_REQUEST['visual_verification_code']) !== $_SESSION['visual_verification_code'])) 
    1422                 { 
    1423                         $_SESSION['visual_errors'] = isset($_SESSION['visual_errors']) ? $_SESSION['visual_errors'] + 1 : 1; 
    1424                         if ($_SESSION['visual_errors'] > 3 && isset($_SESSION['visual_verification_code'])) 
    1425                                 unset($_SESSION['visual_verification_code']); 
    1426  
    1427                         $post_errors[] = 'visual_verification_failed'; 
    1428                 } 
    1429         } 
    1430  
    14311394 
    14321395        // Any mistakes? 
  • trunk/smf/Sources/Profile.php

    r1048 r1121  
    66* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com)                    * 
    77* =============================================================================== * 
    8 * Software Version:           SMF 1.1.10                                          * 
     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) * 
     
    562562                if (strlen(trim($_POST['websiteUrl'])) > 0 && strpos($_POST['websiteUrl'], '://') === false) 
    563563                        $_POST['websiteUrl'] = 'http://' . $_POST['websiteUrl']; 
    564                 if (strlen($_POST['websiteUrl']) < 8) 
     564                if (strlen($_POST['websiteUrl']) < 8 || (substr($_POST['websiteUrl'], 0, 7) !== 'http://' && substr($_POST['websiteUrl'], 0, 8) !== 'https://')) 
    565565                        $_POST['websiteUrl'] = ''; 
    566566        } 
     
    24912491        { 
    24922492                $context['smiley_sets'][$i] = array( 
    2493                         'id' => $set, 
    2494                         'name' => $set_names[$i], 
     2493                        'id' => htmlspecialchars($set), 
     2494                        'name' => htmlspecialchars($set_names[$i]), 
    24952495                        'selected' => $set == $context['member']['smiley_set']['id'] 
    24962496                ); 
    24972497 
    24982498                if ($context['smiley_sets'][$i]['selected']) 
    2499                         $context['member']['smiley_set']['name'] = $set_names[$i]; 
     2499                        $context['member']['smiley_set']['name'] = htmlspecialchars($set_names[$i]); 
    25002500        } 
    25012501 
  • trunk/smf/Sources/Search.php

    r1017 r1121  
    6767        loadTemplate('Search'); 
    6868 
    69         // Generate a visual verification code to make sure the user is no bot. 
    70         $context['visual_verification'] = (empty($modSettings['disable_visual_verification']) || $modSettings['disable_visual_verification'] != 1) && ($user_info['is_guest'] && $modSettings['visual_verification_guest_search']); 
    71         if ($context['visual_verification']) 
    72         { 
    73                 loadLanguage('Login'); 
    74  
    75                 $context['use_graphic_library'] = in_array('gd', get_loaded_extensions()); 
    76                 $context['verificiation_image_href'] = $scripturl . '?action=verificationcode;rand=' . md5(rand()); 
    77  
    78                 // Only generate a new code if one hasn't been set yet 
    79                 if (!isset($_SESSION['visual_verification_code'])) 
    80                 { 
    81                         // Skip I, J, L, O and Q. 
    82                         $character_range = array_merge(range('A', 'H'), array('K', 'M', 'N', 'P'), range('R', 'Z')); 
    83  
    84                         // Generate a new code. 
    85                         $_SESSION['visual_verification_code'] = ''; 
    86                         for ($i = 0; $i < 5; $i++) 
    87                                 $_SESSION['visual_verification_code'] .= $character_range[array_rand($character_range)]; 
    88                 } 
    89         } 
    90  
    91  
    9269        // Check the user's permissions. 
    9370        isAllowedTo('search_posts'); 
     
    293270        isAllowedTo('search_posts'); 
    294271 
    295         // Check whether the visual verification code was entered correctly. 
    296         // We don't want to require it for extra pages though. 
    297         if ((empty($modSettings['disable_visual_verification']) || $modSettings['disable_visual_verification'] != 1) && ($user_info['is_guest'] && $modSettings['visual_verification_guest_search']) && ($_REQUEST['start'] < 2)) 
    298         { 
    299                 if ((empty($_REQUEST['visual_verification_code']) || strtoupper($_REQUEST['visual_verification_code']) !== $_SESSION['visual_verification_code'])) 
    300                 { 
    301                         $_SESSION['visual_errors'] = isset($_SESSION['visual_errors']) ? $_SESSION['visual_errors'] + 1 : 1; 
    302                         if ($_SESSION['visual_errors'] > 3 && isset($_SESSION['visual_verification_code'])) 
    303                                 unset($_SESSION['visual_verification_code']); 
    304  
    305                                 fatal_lang_error('visual_verification_failed', false); 
    306                 } 
    307         } 
    308  
    309  
    310272        require_once($sourcedir . '/Display.php'); 
    311273 
     
    370332 
    371333        // Maximum age of messages. Default to infinite (9999 days: param not set). 
    372  
    373         // Generate a visual verification code to make sure the user is no bot. 
    374         // Used if the search form is shown on the page (for when there are no results) 
    375         $context['visual_verification'] = (empty($modSettings['disable_visual_verification']) || $modSettings['disable_visual_verification'] != 1) && ($user_info['is_guest'] && $modSettings['visual_verification_guest_search']); 
    376         if ($context['visual_verification']) 
    377         { 
    378                 loadLanguage('Login'); 
    379  
    380                 $context['use_graphic_library'] = in_array('gd', get_loaded_extensions()); 
    381                 $context['verificiation_image_href'] = $scripturl . '?action=verificationcode;rand=' . md5(rand()); 
    382  
    383                 // Only generate a new code if one hasn't been set yet 
    384                 if (!isset($_SESSION['visual_verification_code'])) 
    385                 { 
    386                         // Skip I, J, L, O and Q. 
    387                         $character_range = array_merge(range('A', 'H'), array('K', 'M', 'N', 'P'), range('R', 'Z')); 
    388  
    389                         // Generate a new code. 
    390                         $_SESSION['visual_verification_code'] = ''; 
    391                         for ($i = 0; $i < 5; $i++) 
    392                                 $_SESSION['visual_verification_code'] .= $character_range[array_rand($character_range)]; 
    393                 } 
    394         } 
    395  
    396334        if (!empty($search_params['maxage']) || (!empty($_REQUEST['maxage']) && $_REQUEST['maxage'] != 9999)) 
    397335                $search_params['maxage'] = !empty($search_params['maxage']) ? (int) $search_params['maxage'] : (int) $_REQUEST['maxage']; 
  • trunk/smf/Sources/SplitTopics.php

    r1048 r1121  
    66* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com)                    * 
    77* =============================================================================== * 
    8 * Software Version:           SMF 1.1.6                                           * 
     8* Software Version:           SMF 1.1.11                                          * 
    99* Software by:                Simple Machines (http://www.simplemachines.org)     * 
    10 * Copyright 2006-2007 by:     Simple Machines LLC (http://www.simplemachines.org) * 
     10* Copyright 2006-2009 by:     Simple Machines LLC (http://www.simplemachines.org) * 
    1111*           2001-2006 by:     Lewis Media (http://www.lewismedia.com)             * 
    1212* Support, News, Updates at:  http://www.simplemachines.org                       * 
     
    730730                loadTemplate('SplitTopics'); 
    731731        } 
     732        checkSession('request'); 
    732733 
    733734        // Handle URLs from MergeIndex. 
  • trunk/smf/Sources/Subs-Auth.php

    r1048 r1121  
    66* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com)                    * 
    77* =============================================================================== * 
    8 * Software Version:           SMF 1.1.10                                          * 
     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) * 
     
    278278                        // Only if it's not already in the $scripturl! 
    279279                        if (!isset($temp[$k])) 
    280                                 $context['get_data'] .= $k . '=' . $v . ';'; 
     280                                $context['get_data'] .= urlencode($k) . '=' . urlencode($v) . ';'; 
    281281                        // If it changed, put it out there, but with an ampersand. 
    282282                        elseif ($temp[$k] != $_GET[$k]) 
    283                                 $context['get_data'] .= $k . '=' . $v . '&amp;'; 
     283                                $context['get_data'] .= urlencode($k) . '=' . urlencode($v) . '&amp;'; 
    284284                } 
    285285        } 
     
    288288                // Add up all the data from $_GET into get_data. 
    289289                foreach ($_GET as $k => $v) 
    290                         $context['get_data'] .= $k . '=' . $v . ';'; 
     290                        $context['get_data'] .= urlencode($k) . '=' . urlencode($v) . ';'; 
    291291        } 
    292292 
     
    326326        if (!is_array($v)) 
    327327                return ' 
    328 <input type="hidden" name="' . $k . '" value="' . strtr(stripslashes($v), array('"' => '&quot;', '<' => '&lt;', '>' => '&gt;')) . '" />'; 
     328<input type="hidden" name="' . htmlspecialchars($k) . '" value="' . strtr(stripslashes($v), array('"' => '&quot;', '<' => '&lt;', '>' => '&gt;')) . '" />'; 
    329329        else 
    330330        { 
  • trunk/smf/Sources/Subs-Boards.php

    r1017 r1121  
    66* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com)                    * 
    77* =============================================================================== * 
    8 * Software Version:           SMF 1.1.5                                           * 
     8* Software Version:           SMF 1.1.11                                          * 
    99* Software by:                Simple Machines (http://www.simplemachines.org)     * 
    10 * Copyright 2006 by:          Simple Machines LLC (http://www.simplemachines.org) * 
     10* Copyright 2006-2009 by:     Simple Machines LLC (http://www.simplemachines.org) * 
    1111*           2001-2006 by:     Lewis Media (http://www.lewismedia.com)             * 
    1212* Support, News, Updates at:  http://www.simplemachines.org                       * 
     
    400400{ 
    401401        global $ID_MEMBER, $db_prefix, $sourcedir; 
     402 
     403        checkSession('request'); 
    402404 
    403405        $_REQUEST['c'] = (int) $_REQUEST['c']; 
  • trunk/smf/Sources/Subs-Graphics.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) * 
     
    265265 
    266266        // Ask for more memory: we need it for this, and it'll only happen once! 
    267         @ini_set('memory_limit', '48M'); 
     267        @ini_set('memory_limit', '90M'); 
    268268 
    269269        $success = false; 
  • 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        } 
  • trunk/smf/Sources/Themes.php

    r1048 r1121  
    66* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com)                    * 
    77* =============================================================================== * 
    8 * Software Version:           SMF 1.1.7                                           * 
     8* Software Version:           SMF 1.1.11                                          * 
    99* Software by:                Simple Machines (http://www.simplemachines.org)     * 
    10 * Copyright 2006-2007 by:     Simple Machines LLC (http://www.simplemachines.org) * 
     10* Copyright 2006-2009 by:     Simple Machines LLC (http://www.simplemachines.org) * 
    1111*           2001-2006 by:     Lewis Media (http://www.lewismedia.com)             * 
    1212* Support, News, Updates at:  http://www.simplemachines.org                       * 
     
    678678        ); 
    679679        foreach ($sets as $i => $set) 
    680                 $context['smiley_sets'][$set] = $set_names[$i]; 
     680                $context['smiley_sets'][$set] = htmlspecialchars($set_names[$i]); 
    681681 
    682682        $old_id = $settings['theme_id']; 
  • trunk/smf/Themes/default/Admin.template.php

    r1017 r1121  
    891891                                <td valign="top"> 
    892892                                        <input type="checkbox" name="enableSpellChecking" id="enableSpellChecking_check"', empty($modSettings['enableSpellChecking']) ? '' : ' checked="checked"', ' class="check" /> 
    893                                 </td> 
    894  
    895                         </tr><tr class="windowbg2"> 
    896                                 <th width="50%" align="right"> 
    897                                         <label for="visual_verification_guest_post_check">', $txt['visual_verification_guest_post'], '</label>: 
    898                                 </th> 
    899                                 <td valign="top"> 
    900                                         <input type="checkbox" name="visual_verification_guest_post" id="visual_verification_guest_post_check"', empty($modSettings['visual_verification_guest_post']) ? '' : ' checked="checked"', ' class="check" /> 
    901893                                </td> 
    902894                        </tr><tr class="windowbg2"> 
  • trunk/smf/Themes/default/ManageSearch.template.php

    r1017 r1121  
    2929                                <th width="50%" align="right"><label for="simpleSearch_check">', $txt['simpleSearch'], '</label> (<a href="', $scripturl, '?action=helpadmin;help=simpleSearch" onclick="return reqWin(this.href);">?</a>):</th> 
    3030                                <td><input type="checkbox" name="simpleSearch" id="simpleSearch_check"', empty($modSettings['simpleSearch']) ? '' : ' checked="checked"', ' class="check" /></td> 
    31                         </tr><tr class="windowbg2"> 
    32  
    33                                 <th align="right"><label for="visual_verification_guest_search_check">', $txt['visual_verification_guest_search'], ':</label></th> 
    34                                 <td><input type="checkbox" name="visual_verification_guest_search" id="visual_verification_guest_search_check"', empty($modSettings['visual_verification_guest_search']) ? '' : ' checked="checked"', ' class="check" /></td> 
    3531                        </tr><tr class="windowbg2"> 
    3632                                <th align="right"><label for="search_results_per_page_input">', $txt['search_results_per_page'], ':</label></th> 
  • trunk/smf/Themes/default/Packages.template.php

    r1048 r1121  
    11<?php 
    2 // Version: 1.1.8; Packages 
     2// Version: 1.1.11; Packages 
    33 
    44function template_main() 
     
    711711                                                        </td> 
    712712                                                        <td> 
    713                                                                 <a href="' . $scripturl . '?action=packageget;sa=remove;server=' . $server['id'] . '">[ ' . $txt['smf138'] . ' ]</a> 
     713                                                                <a href="' . $scripturl . '?action=packageget;sa=remove;server=' . $server['id'] . ';sesc=', $context['session_id'], '">[ ' . $txt['smf138'] . ' ]</a> 
    714714                                                        </td> 
    715715                                                </tr>'; 
  • trunk/smf/Themes/default/Post.template.php

    r1017 r1121  
    519519                                                                                </td> 
    520520                                                                        </tr>'; 
    521  
    522         if ($context['visual_verification']) 
    523         { 
    524                 echo ' 
    525                         <tr align="right" valign="top"> 
    526                                 <td style="font-weight: bold;', isset($context['post_error']['visual_verification_failed']) ? 'color: red;' : '', '"> 
    527  
    528                                         <script language="JavaScript" type="text/javascript"><!-- // --> 
    529                                         function refreshImages() 
    530                                         { 
    531                                                 // Make sure we are using a new rand code. 
    532                                                 var new_url = new String("', $context['verificiation_image_href'], '"); 
    533                                                 new_url = new_url.substr(0, new_url.indexOf("rand=") + 5); 
    534  
    535                                                 // Quick and dirty way of converting decimal to hex 
    536                                                 var hexstr = "0123456789abcdef"; 
    537                                                 for(var i=0; i < 32; i++) 
    538                                                         new_url = new_url + hexstr.substr(Math.floor(Math.random() * 16), 1);'; 
    539  
    540                                                 if ($context['use_graphic_library']) 
    541                                                         echo ' 
    542                                                 document.getElementById("verificiation_image").src = new_url;'; 
    543                                                 else 
    544                                                         echo ' 
    545                                                 document.getElementById("verificiation_image_1").src = new_url + ";letter=1"; 
    546                                                 document.getElementById("verificiation_image_2").src = new_url + ";letter=2"; 
    547                                                 document.getElementById("verificiation_image_3").src = new_url + ";letter=3"; 
    548                                                 document.getElementById("verificiation_image_4").src = new_url + ";letter=4"; 
    549                                                 document.getElementById("verificiation_image_5").src = new_url + ";letter=5";'; 
    550                                                 echo ' 
    551                                         } 
    552                                                 // ]]&gt;</script> 
    553  
    554                                         ', $txt['visual_verification_label'], ': 
    555                                         <div class="smalltext">', $txt['visual_verification_description'], '</div> 
    556                                 </td> 
    557                                 <td align="left" valign="top">'; 
    558 if ($context['use_graphic_library']) 
    559         echo ' 
    560                                         <img src="', $context['verificiation_image_href'], '" alt="', $txt['visual_verification_description'], '" id="verificiation_image" /><br />'; 
    561 else 
    562         echo ' 
    563                                         <img src="', $context['verificiation_image_href'], ';letter=1" alt="', $txt['visual_verification_description'], '" id="verificiation_image_1" /> 
    564                                         <img src="', $context['verificiation_image_href'], ';letter=2" alt="', $txt['visual_verification_description'], '" id="verificiation_image_2" /> 
    565                                         <img src="', $context['verificiation_image_href'], ';letter=3" alt="', $txt['visual_verification_description'], '" id="verificiation_image_3" /> 
    566                                         <img src="', $context['verificiation_image_href'], ';letter=4" alt="', $txt['visual_verification_description'], '" id="verificiation_image_4" /> 
    567                                         <img src="', $context['verificiation_image_href'], ';letter=5" alt="', $txt['visual_verification_description'], '" id="verificiation_image_5" />'; 
    568 echo ' 
    569                                         <input type="text" name="visual_verification_code" size="30" tabindex="', $context['tabindex']++, '" /> 
    570                                         <div class="smalltext"> 
    571                                                 <a href="', $context['verificiation_image_href'], ';sound" onclick="return reqWin(this.href, 400, 120);">', $txt['visual_verification_sound'], '</a> | <a href="', $scripturl, '" onclick="refreshImages(); return false;">', $txt['visual_verification_request_new'], '</a> 
    572                                         </div> 
    573                                 </td> 
    574                         </tr>'; 
    575         } 
    576  
    577521 
    578522        // If the admin has enabled the hiding of the additional options - show a link and image for it. 
  • trunk/smf/Themes/default/Search.template.php

    r1017 r1121  
    5555                                <td class="windowbg">'; 
    5656 
    57         if ($context['visual_verification']) 
    58         { 
    59                 echo ' 
    60                                         <script language="JavaScript" type="text/javascript"><!-- // --> 
    61                                         function refreshImages() 
    62                                         { 
    63                                                 // Make sure we are using a new rand code. 
    64                                                 var new_url = new String("', $context['verificiation_image_href'], '"); 
    65                                                 new_url = new_url.substr(0, new_url.indexOf("rand=") + 5); 
    66  
    67                                                 // Quick and dirty way of converting decimal to hex 
    68                                                 var hexstr = "0123456789abcdef"; 
    69                                                 for(var i=0; i < 32; i++) 
    70                                                         new_url = new_url + hexstr.substr(Math.floor(Math.random() * 16), 1);'; 
    71  
    72                                                 if ($context['use_graphic_library']) 
    73                                                         echo ' 
    74                                                 document.getElementById("verificiation_image").src = new_url;'; 
    75                                                 else 
    76                                                         echo ' 
    77                                                 document.getElementById("verificiation_image_1").src = new_url + ";letter=1"; 
    78                                                 document.getElementById("verificiation_image_2").src = new_url + ";letter=2"; 
    79                                                 document.getElementById("verificiation_image_3").src = new_url + ";letter=3"; 
    80                                                 document.getElementById("verificiation_image_4").src = new_url + ";letter=4"; 
    81                                                 document.getElementById("verificiation_image_5").src = new_url + ";letter=5";'; 
    82                                                 echo ' 
    83                                         } 
    84                                                 // ]]&gt;</script>'; 
    85         } 
    86  
    87  
    8857        if ($context['simple_search']) 
    8958        { 
     
    10069                                                <td></td> 
    10170                                        </tr>'; 
    102  
    103                         if ($context['visual_verification']) 
    104                         { 
    105                                 echo ' 
    106                                         <tr> 
    107                                                 <td> 
    108                                                         <div style="font-weight: bold;"> 
    109                                                                 ', $txt['visual_verification_label'], ': 
    110                                                                 <div class="smalltext">', $txt['visual_verification_description'], '</div> 
    111                                                         </div> 
    112                                                         <div>'; 
    113                         if ($context['use_graphic_library']) 
    114                                 echo ' 
    115                                                                 <img src="', $context['verificiation_image_href'], '" alt="', $txt['visual_verification_description'], '" id="verificiation_image" /><br />'; 
    116                         else 
    117                                 echo ' 
    118                                                                 <img src="', $context['verificiation_image_href'], ';letter=1" alt="', $txt['visual_verification_description'], '" id="verificiation_image_1" /> 
    119                                                                 <img src="', $context['verificiation_image_href'], ';letter=2" alt="', $txt['visual_verification_description'], '" id="verificiation_image_2" /> 
    120                                                                 <img src="', $context['verificiation_image_href'], ';letter=3" alt="', $txt['visual_verification_description'], '" id="verificiation_image_3" /> 
    121                                                                 <img src="', $context['verificiation_image_href'], ';letter=4" alt="', $txt['visual_verification_description'], '" id="verificiation_image_4" /> 
    122                                                                 <img src="', $context['verificiation_image_href'], ';letter=5" alt="', $txt['visual_verification_description'], '" id="verificiation_image_5" />'; 
    123                         echo ' 
    124                                                                 <input type="text" name="visual_verification_code" size="30" tabindex="', $context['tabindex']++, '" /> 
    125                                                                 <div class="smalltext"> 
    126                                                                         <a href="', $context['verificiation_image_href'], ';sound" onclick="return reqWin(this.href, 400, 120);">', $txt['visual_verification_sound'], '</a> | <a href="', $scripturl, '" onclick="refreshImages(); return false;">', $txt['visual_verification_request_new'], '</a> 
    127                                                                 </div> 
    128                                                         </div> 
    129                                                 </td> 
    130                                         </tr>'; 
    131                         } 
    132  
    133  
    13471                echo ' 
    13572                                        </table><br /><br /> 
     
    220157                                                        <td></td> 
    221158                                                </tr> 
    222 '; 
    223  
    224                         if ($context['visual_verification']) 
    225                         { 
    226                                 echo ' 
    227                                                 <tr> 
    228                                                         <td style="padding-top: 2ex;"> 
    229                                                                 <div style="font-weight: bold;"> 
    230                                                                         ', $txt['visual_verification_label'], ': 
    231                                                                         <div class="smalltext">', $txt['visual_verification_description'], '</div> 
    232                                                                 </div> 
    233                                                                 <div>'; 
    234                                 if ($context['use_graphic_library']) 
    235                                         echo ' 
    236                                                                         <img src="', $context['verificiation_image_href'], '" alt="', $txt['visual_verification_description'], '" id="verificiation_image" /><br />'; 
    237                                 else 
    238                                         echo ' 
    239                                                                         <img src="', $context['verificiation_image_href'], ';letter=1" alt="', $txt['visual_verification_description'], '" id="verificiation_image_1" /> 
    240                                                                         <img src="', $context['verificiation_image_href'], ';letter=2" alt="', $txt['visual_verification_description'], '" id="verificiation_image_2" /> 
    241                                                                         <img src="', $context['verificiation_image_href'], ';letter=3" alt="', $txt['visual_verification_description'], '" id="verificiation_image_3" /> 
    242                                                                         <img src="', $context['verificiation_image_href'], ';letter=4" alt="', $txt['visual_verification_description'], '" id="verificiation_image_4" /> 
    243                                                                         <img src="', $context['verificiation_image_href'], ';letter=5" alt="', $txt['visual_verification_description'], '" id="verificiation_image_5" />'; 
    244                                 echo ' 
    245                                                                         <input type="text" name="visual_verification_code" size="30" tabindex="', $context['tabindex']++, '" /> 
    246                                                                         <div class="smalltext"> 
    247                                                                                 <a href="', $context['verificiation_image_href'], ';sound" onclick="return reqWin(this.href, 400, 120);">', $txt['visual_verification_sound'], '</a> | <a href="', $scripturl, '" onclick="refreshImages(); return false;">', $txt['visual_verification_request_new'], '</a> 
    248                                                                         </div> 
    249                                                                 </div> 
    250                                                         </td> 
    251                                                 </tr>'; 
    252                         } 
    253  
    254 echo ' 
    255  
    256159                                        </table><br />'; 
    257160 
     
    318221        if (isset($context['did_you_mean']) || empty($context['topics'])) 
    319222        { 
    320  
    321                 if ($context['visual_verification']) 
    322                 { 
    323                         echo ' 
    324                                                 <script language="JavaScript" type="text/javascript"><!-- // --> 
    325                                                 function refreshImages() 
    326                                                 { 
    327                                                         // Make sure we are using a new rand code. 
    328                                                         var new_url = new String("', $context['verificiation_image_href'], '"); 
    329                                                         new_url = new_url.substr(0, new_url.indexOf("rand=") + 5); 
    330  
    331                                                         // Quick and dirty way of converting decimal to hex 
    332                                                         var hexstr = "0123456789abcdef"; 
    333                                                         for(var i=0; i < 32; i++) 
    334                                                                 new_url = new_url + hexstr.substr(Math.floor(Math.random() * 16), 1);'; 
    335  
    336                                                         if ($context['use_graphic_library']) 
    337                                                                 echo ' 
    338                                                         document.getElementById("verificiation_image").src = new_url;'; 
    339                                                         else 
    340                                                                 echo ' 
    341                                                         document.getElementById("verificiation_image_1").src = new_url + ";letter=1"; 
    342                                                         document.getElementById("verificiation_image_2").src = new_url + ";letter=2"; 
    343                                                         document.getElementById("verificiation_image_3").src = new_url + ";letter=3"; 
    344                                                         document.getElementById("verificiation_image_4").src = new_url + ";letter=4"; 
    345                                                         document.getElementById("verificiation_image_5").src = new_url + ";letter=5";'; 
    346                                                         echo ' 
    347                                                 } 
    348                                                         // ]]&gt;</script>'; 
    349                 } 
    350223                echo ' 
    351224        <div class="tborder"> 
     
    367240                                                <input type="text" name="search"', !empty($context['search_params']['search']) ? ' value="' . $context['search_params']['search'] . '"' : '', ' size="40" /> 
    368241                                                <input type="submit" name="submit" value="', $txt['search_adjust_submit'], '" /> 
    369  
    370                                                 '; 
    371  
    372                                                 if ($context['visual_verification']) 
    373                                                 { 
    374                                                         echo '<br /><br /> 
    375                                                         <b>', $txt['visual_verification_label'], ':</b><br /> 
    376                                                         <div class="smalltext">', $txt['visual_verification_description'], '</div>'; 
    377  
    378                                                         if ($context['use_graphic_library']) 
    379                                                                 echo ' 
    380                                                                                                 <img src="', $context['verificiation_image_href'], '" alt="', $txt['visual_verification_description'], '" id="verificiation_image" /><br />'; 
    381                                                         else 
    382                                                                 echo ' 
    383                                                                                                 <img src="', $context['verificiation_image_href'], ';letter=1" alt="', $txt['visual_verification_description'], '" id="verificiation_image_1" /> 
    384                                                                                                 <img src="', $context['verificiation_image_href'], ';letter=2" alt="', $txt['visual_verification_description'], '" id="verificiation_image_2" /> 
    385                                                                                                 <img src="', $context['verificiation_image_href'], ';letter=3" alt="', $txt['visual_verification_description'], '" id="verificiation_image_3" /> 
    386                                                                                                 <img src="', $context['verificiation_image_href'], ';letter=4" alt="', $txt['visual_verification_description'], '" id="verificiation_image_4" /> 
    387                                                                                                 <img src="', $context['verificiation_image_href'], ';letter=5" alt="', $txt['visual_verification_description'], '" id="verificiation_image_5" />'; 
    388                                                         echo ' 
    389                                                                                                 <input type="text" name="visual_verification_code" size="30" tabindex="', $context['tabindex']++, '" /> 
    390                                                                                                 <div class="smalltext"> 
    391                                                                                                         <a href="', $context['verificiation_image_href'], ';sound" onclick="return reqWin(this.href, 400, 120);">', $txt['visual_verification_sound'], '</a> | <a href="', $scripturl, '" onclick="refreshImages(); return false;">', $txt['visual_verification_request_new'], '</a> 
    392                                                                                                 </div><br />'; 
    393                                                 } 
    394  
    395                 echo ' 
    396242 
    397243                                                <input type="hidden" name="searchtype" value="', !empty($context['search_params']['searchtype']) ? $context['search_params']['searchtype'] : 0, '" /> 
  • trunk/smf/Themes/default/SplitTopics.template.php

    r852 r1121  
    11<?php 
    2 // Version: 1.1; SplitTopics 
     2// Version: 1.1.11; SplitTopics 
    33 
    44function template_ask() 
     
    399399                                                <input type="submit" value="' . $txt['smf252'] . '" /> 
    400400                                                <input type="hidden" name="sa" value="execute" /> 
     401                                                <input type="hidden" name="sc" value="', $context['session_id'], '" /> 
    401402                                        </td> 
    402403                                </tr> 
  • trunk/smf/Themes/default/index.template.php

    r1017 r1121  
    129129                $options['collapse_header_ic'] = !empty($_COOKIE['upshrinkIC']); 
    130130        } 
     131 
     132    echo '<script type="text/javascript" src="http://summify.com/client/v1/249f00c6/client.js"></script>'; 
    131133 
    132134        // Output any remaining HTML headers. (from mods, maybe?) 
  • trunk/smf/index.php

    r1048 r1121  
    66* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com)                    * 
    77* =============================================================================== * 
    8 * Software Version:           SMF 1.1.10                                          * 
     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) * 
     
    3535*/ 
    3636 
    37 $forum_version = 'SMF 1.1.10'; 
     37$forum_version = 'SMF 1.1.11'; 
    3838 
    3939// Get everything started up... 
  • trunk/www/views/header.php

    r1119 r1121  
    6969    <script type="text/javascript" src="<?= html_escape(url_static('js/tags.js')) ?>"></script> 
    7070    <script type="text/javascript" src="<?= html_escape(url_static('js/roundtimer.js')) ?>"></script> 
     71 
     72    <script type="text/javascript" src="http://summify.com/client/v1/249f00c6/client.js"></script> 
    7173 
    7274    <script type="text/javascript">Sh_Init("<?= html_escape(url_static('swf/clipboard.swf')) ?>")</script> 
  • trunk/www/views/job_detail.php

    r997 r1121  
    8888        } 
    8989        echo '<td class="number">'.$test['test_number'].'</td>'; 
    90         echo '<td class="number">'.$test['exec_time'].'ms</td>'; 
    91         echo '<td class="number">'.$test['mem_used'].'kb</td>'; 
     90        if ($test["grader_message"] == "Time limit exceeded.") { 
     91            echo '<td class="number">Depăşit</td>'; 
     92        } else { 
     93            echo '<td class="number">'.$test['exec_time'].'ms</td>'; 
     94        } 
     95        if ($test["grader_message"] == "Memory limit exceeded.") { 
     96            echo '<td class="number">Depăşit</td>'; 
     97        } else { 
     98            echo '<td class="number">'.$test['mem_used'].'kb</td>'; 
     99        } 
    92100        echo '<td>'.html_escape($test['grader_message']).'</td>'; 
    93101        echo '<td class="number">'.$test['points'].'</td>'; 
Note: See TracChangeset for help on using the changeset viewer.