Changeset 1121 for trunk/smf/Sources/ManageSmileys.php
- Timestamp:
- 03/29/10 15:37:29 (2 years ago)
- File:
-
- 1 edited
-
trunk/smf/Sources/ManageSmileys.php (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/smf/Sources/ManageSmileys.php
r852 r1121 6 6 * Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com) * 7 7 * =============================================================================== * 8 * Software Version: SMF 1.1.1 *8 * Software Version: SMF 1.1.11 * 9 9 * 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) * 11 11 * 2001-2006 by: Lewis Media (http://www.lewismedia.com) * 12 12 * Support, News, Updates at: http://www.simplemachines.org * … … 175 175 $context['smiley_sets'][$i] = array( 176 176 'id' => $i, 177 'path' => $set,178 'name' => $set_names[$i],177 'path' => htmlspecialchars($set), 178 'name' => htmlspecialchars($set_names[$i]), 179 179 'selected' => $set == $modSettings['smiley_sets_default'] 180 180 ); … … 267 267 $context['smiley_sets'][$i] = array( 268 268 'id' => $i, 269 'path' => $set,270 'name' => $set_names[$i],269 'path' => htmlspecialchars($set), 270 'name' => htmlspecialchars($set_names[$i]), 271 271 'selected' => $set == $modSettings['smiley_sets_default'] 272 272 ); … … 280 280 // Sanity check - then import. 281 281 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'])); 283 283 284 284 // Force the process to continue. … … 362 362 $context['smiley_sets'][$i] = array( 363 363 'id' => $i, 364 'path' => $set,365 'name' => $set_names[$i],364 'path' => htmlspecialchars($set), 365 'name' => htmlspecialchars($set_names[$i]), 366 366 'selected' => $set == $modSettings['smiley_sets_default'] 367 367 ); … … 399 399 foreach ($context['smiley_sets'] as $set) 400 400 { 401 if (!is_writable($context['smileys_dir'] . '/' . $set['path']))401 if (!is_writable($context['smileys_dir'] . '/' . un_htmlspecialchars($set['path']))) 402 402 $writeErrors[] = $set['path']; 403 403 } … … 429 429 $i = 0; 430 430 // 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)) 432 432 $i++; 433 433 … … 435 435 if (isset($context['smiley_sets'][$i]['path'])) 436 436 { 437 $smileyLocation = $context['smileys_dir'] . '/' . $context['smiley_sets'][$i]['path']. '/' . $destName;437 $smileyLocation = $context['smileys_dir'] . '/' . un_htmlspecialchars($context['smiley_sets'][$i]['path']) . '/' . $destName; 438 438 move_uploaded_file($_FILES['uploadSmiley']['tmp_name'], $smileyLocation); 439 439 @chmod($smileyLocation, 0644); … … 442 442 for ($n = count($context['smiley_sets']); $i < $n; $i++) 443 443 { 444 $currentPath = $context['smileys_dir'] . '/' . $context['smiley_sets'][$i]['path']. '/' . $destName;444 $currentPath = $context['smileys_dir'] . '/' . un_htmlspecialchars($context['smiley_sets'][$i]['path']) . '/' . $destName; 445 445 446 446 // The file is already there! Don't overwrite it! … … 473 473 foreach ($context['smiley_sets'] as $i => $set) 474 474 { 475 $set['name'] = un_htmlspecialchars($set['name']); 476 $set['path'] = un_htmlspecialchars($set['path']); 477 475 478 if (!isset($_FILES['individual_' . $set['name']]['name']) || $_FILES['individual_' . $set['name']]['name'] == '') 476 479 continue; … … 547 550 foreach ($context['smiley_sets'] as $smiley_set) 548 551 { 549 if (!file_exists($context['smileys_dir'] . '/' . $smiley_set['path']))552 if (!file_exists($context['smileys_dir'] . '/' . un_htmlspecialchars($smiley_set['path']))) 550 553 continue; 551 554 552 $dir = dir($context['smileys_dir'] . '/' . $smiley_set['path']);555 $dir = dir($context['smileys_dir'] . '/' . un_htmlspecialchars($smiley_set['path'])); 553 556 while ($entry = $dir->read()) 554 557 { … … 665 668 $context['smiley_sets'][$i] = array( 666 669 'id' => $i, 667 'path' => $set,668 'name' => $set_names[$i],670 'path' => htmlspecialchars($set), 671 'name' => htmlspecialchars($set_names[$i]), 669 672 'selected' => $set == $modSettings['smiley_sets_default'] 670 673 ); … … 706 709 { 707 710 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'])) 709 712 $context['smileys'][$smiley_id]['sets_not_found'][] = $smiley_set['path']; 710 713 } … … 724 727 $context['smiley_sets'][$i] = array( 725 728 'id' => $i, 726 'path' => $set,727 'name' => $set_names[$i],729 'path' => htmlspecialchars($set), 730 'name' => htmlspecialchars($set_names[$i]), 728 731 'selected' => $set == $modSettings['smiley_sets_default'] 729 732 ); … … 737 740 foreach ($context['smiley_sets'] as $smiley_set) 738 741 { 739 if (!file_exists($context['smileys_dir'] . '/' . $smiley_set['path']))742 if (!file_exists($context['smileys_dir'] . '/' . un_htmlspecialchars($smiley_set['path']))) 740 743 continue; 741 744 742 $dir = dir($context['smileys_dir'] . '/' . $smiley_set['path']);745 $dir = dir($context['smileys_dir'] . '/' . un_htmlspecialchars($smiley_set['path'])); 743 746 while ($entry = $dir->read()) 744 747 {
Note: See TracChangeset
for help on using the changeset viewer.
![[infoarena] development](/chrome/site/logo.png)