* Software Version: SMF 2.0 RC1 *
* Software Version: SMF 2.0 RC1.2 *
'type' => $txt['execute_modification'],
'action' => strtr($action['filename'], array($boarddir => '.')),
'type' => $txt['execute_modification'],
'action' => $smcFunc['htmlspecialchars'](strtr($action['filename'], array($boarddir => '.'))),
$context['theme_actions'][$mod_action['is_custom']]['actions'][$actual_filename] = array(
'type' => $txt['execute_modification'],
'action' => strtr($mod_action['filename'], array($boarddir => '.')),
$context['theme_actions'][$mod_action['is_custom']]['actions'][$actual_filename] = array(
'type' => $txt['execute_modification'],
'action' => $smcFunc['htmlspecialchars'](strtr($mod_action['filename'], array($boarddir => '.'))),
$context['actions'][$actual_filename] = array(
'type' => $txt['execute_modification'],
'action' => strtr($mod_action['filename'], array($boarddir => '.')),
$context['actions'][$actual_filename] = array(
'type' => $txt['execute_modification'],
'action' => $smcFunc['htmlspecialchars'](strtr($mod_action['filename'], array($boarddir => '.'))),
'action' => strtr($mod_action['filename'], array($boarddir => '.')),
'description' => $txt['package_action_skipping']
'action' => $smcFunc['htmlspecialchars'](strtr($mod_action['filename'], array($boarddir => '.'))),
'description' => $txt['package_action_skipping']
'action' => strtr($mod_action['filename'], array($boarddir => '.')),
'description' => $txt['package_action_missing']
'action' => $smcFunc['htmlspecialchars'](strtr($mod_action['filename'], array($boarddir => '.'))),
'description' => $txt['package_action_missing']
'action' => strtr($mod_action['filename'], array($boarddir => '.')),
'description' => $txt['package_action_error']
'action' => $smcFunc['htmlspecialchars'](strtr($mod_action['filename'], array($boarddir => '.'))),
'description' => $txt['package_action_error']
$context['actions'][$actual_filename]['operations'][] = array(
'type' => $txt['execute_modification'],
'action' => strtr($mod_action['filename'], array($boarddir => '.')),
$context['actions'][$actual_filename]['operations'][] = array(
'type' => $txt['execute_modification'],
'action' => $smcFunc['htmlspecialchars'](strtr($mod_action['filename'], array($boarddir => '.'))),
$context['theme_actions'][$mod_action['is_custom']]['actions'][$actual_filename]['operations'][] = array(
'type' => $txt['execute_modification'],
'action' => strtr($mod_action['filename'], array($boarddir => '.')),
$context['theme_actions'][$mod_action['is_custom']]['actions'][$actual_filename]['operations'][] = array(
'type' => $txt['execute_modification'],
'action' => $smcFunc['htmlspecialchars'](strtr($mod_action['filename'], array($boarddir => '.'))),
'type' => $txt['execute_code'],
'action' => $action['filename']
'type' => $txt['execute_code'],
'action' => $smcFunc['htmlspecialchars']($action['filename'])
'type' => $txt['execute_database_changes'],
'action' => $action['filename']
'type' => $txt['execute_database_changes'],
'action' => $smcFunc['htmlspecialchars']($action['filename'])
'type' => $txt['package_create'] . ' ' . ($action['type'] == 'create-dir' ? $txt['package_tree'] : $txt['package_file']),
'action' => strtr($action['destination'], array($boarddir => '.'))
'type' => $txt['package_create'] . ' ' . ($action['type'] == 'create-dir' ? $txt['package_tree'] : $txt['package_file']),
'action' => $smcFunc['htmlspecialchars'](strtr($action['destination'], array($boarddir => '.')))
'type' => $txt['package_extract'] . ' ' . ($action['type'] == 'require-dir' ? $txt['package_tree'] : $txt['package_file']),
'action' => strtr($action['destination'], array($boarddir => '.'))
'type' => $txt['package_extract'] . ' ' . ($action['type'] == 'require-dir' ? $txt['package_tree'] : $txt['package_file']),
'action' => $smcFunc['htmlspecialchars'](strtr($action['destination'], array($boarddir => '.')))
'type' => $txt['package_move'] . ' ' . ($action['type'] == 'move-dir' ? $txt['package_tree'] : $txt['package_file']),
'action' => strtr($action['source'], array($boarddir => '.')) . ' => ' . strtr($action['destination'], array($boarddir => '.'))
'type' => $txt['package_move'] . ' ' . ($action['type'] == 'move-dir' ? $txt['package_tree'] : $txt['package_file']),
'action' => $smcFunc['htmlspecialchars'](strtr($action['source'], array($boarddir => '.'))) . ' => ' . $smcFunc['htmlspecialchars'](strtr($action['destination'], array($boarddir => '.')))
'type' => $txt['package_delete'] . ' ' . ($action['type'] == 'remove-dir' ? $txt['package_tree'] : $txt['package_file']),
'action' => strtr($action['filename'], array($boarddir => '.'))
'type' => $txt['package_delete'] . ' ' . ($action['type'] == 'remove-dir' ? $txt['package_tree'] : $txt['package_file']),
'action' => $smcFunc['htmlspecialchars'](strtr($action['filename'], array($boarddir => '.')))
* Software Version: SMF 2.0 RC1-1 *
* Software Version: SMF 2.0 RC1.2 *
// Check if it's locked. It isn't locked if no topic is specified.
if (!empty($topic))
// No message is complete without a topic.
if (empty($topic) && !empty($_REQUEST['msg']))
{
$request = $smcFunc['db_query']('', '
SELECT id_topic
FROM {db_prefix}messages
WHERE id_msg = {int:msg}',
array(
'msg' => (int) $_REQUEST['msg'],
));
if ($smcFunc['db_num_rows']($request) != 1)
unset($_REQUEST['msg'], $_POST['msg'], $_GET['msg']);
else
list($topic) = $smcFunc['db_fetch_row']($request);
$smcFunc['db_free_result']($request);
}
// Check if it's locked. It isn't locked if no topic is specified.
if (!empty($topic))
// Previewing an edit?
if (isset($_REQUEST['msg']))
{
// Previewing an edit?
if (isset($_REQUEST['msg']) && !empty($topic))
{
// Get the existing message.
$request = $smcFunc['db_query']('', '
SELECT
m.id_member, m.modified_time, m.smileys_enabled, m.body,
m.poster_name, m.poster_email, m.subject, m.icon, m.approved,
IFNULL(a.size, -1) AS filesize, a.filename, a.id_attach,
a.approved AS attachment_approved, t.id_member_started AS id_member_poster,
m.poster_time
FROM {db_prefix}messages AS m
INNER JOIN {db_prefix}topics AS t ON (t.id_topic = {int:current_topic})
LEFT JOIN {db_prefix}attachments AS a ON (a.id_msg = m.id_msg AND a.attachment_type = {int:attachment_type})
WHERE m.id_msg = {int:id_msg}
AND m.id_topic = {int:current_topic}',
array(
'current_topic' => $topic,
'attachment_type' => 0,
'id_msg' => $_REQUEST['msg'],
)
);
// The message they were trying to edit was most likely deleted.
// !!! Change this error message?
if ($smcFunc['db_num_rows']($request) == 0)
fatal_lang_error('no_board', false);
$row = $smcFunc['db_fetch_assoc']($request);
$attachment_stuff = array($row);
while ($row2 = $smcFunc['db_fetch_assoc']($request))
$attachment_stuff[] = $row2;
$smcFunc['db_free_result']($request);
if ($row['id_member'] == $user_info['id'] && !allowedTo('modify_any'))
{
// Give an extra five minutes over the disable time threshold, so they can type - assuming the post is public.
if ($row['approved'] && !empty($modSettings['edit_disable_time']) && $row['poster_time'] + ($modSettings['edit_disable_time'] + 5) * 60 < time())
fatal_lang_error('modify_post_time_passed', false);
elseif ($row['id_member_poster'] == $user_info['id'] && !allowedTo('modify_own'))
isAllowedTo('modify_replies');
else
isAllowedTo('modify_own');
}
elseif ($row['id_member_poster'] == $user_info['id'] && !allowedTo('modify_any'))
isAllowedTo('modify_replies');
else
isAllowedTo('modify_any');
* Software Version: SMF 2.0 RC1 *
* Software Version: SMF 2.0 RC1.2 *
// Version 4.3.2 didn't store the cookie of the new session.
if (version_compare(PHP_VERSION, '4.3.2') === 0)
setcookie(session_name(), session_id(), time() + $cookie_length, $cookie_url[1], '', !empty($modSettings['secureCookies']));
// Version 4.3.2 didn't store the cookie of the new session.
if (version_compare(PHP_VERSION, '4.3.2') === 0 || (isset($_COOKIE[session_name()]) && $_COOKIE[session_name()] != session_id()))
setcookie(session_name(), session_id(), time() + $cookie_length, $cookie_url[1], '', !empty($modSettings['secureCookies']));
if (document.forms.postForm.emailActivate.checked)
if (document.forms.postForm.emailActivate.checked || document.forms.postForm.password.value == \'\')
<input type="password" name="password" id="password_input" tabindex="', $context['tabindex']++, '" size="30" /><br />
<input type="password" name="password" id="password_input" tabindex="', $context['tabindex']++, '" size="30" onchange="onCheckChange();" /><br />
<input type="checkbox" name="emailPassword" id="emailPassword_check" tabindex="', $context['tabindex']++, '" checked="checked"', !empty($modSettings['registration_method']) && $modSettings['registration_method'] == 1 ? ' disabled="disabled"' : '', ' class="check" /><br />
<input type="checkbox" name="emailPassword" id="emailPassword_check" tabindex="', $context['tabindex']++, '" checked="checked" disabled="disabled" class="check" /><br />
$avatar_hash = empty($modSettings['custom_avatar_enabled']) ? getAttachmentFilename($destName, false, null, true) : null;
$avatar_hash = empty($modSettings['custom_avatar_enabled']) ? getAttachmentFilename($destName, false, null, true) : '';
while (!feof($fp2))
fwrite($fp, fread($fp2, 8192));
fclose($fp2);
// Though not an exhaustive list, better safe than sorry.
if (preg_match('~(iframe|\\<\\?php|\\<\\?|\\<%|html|eval|body|script)~', $destName) === 1)
{
unlink($destName);
return false;
}
$prev_chunk = '';
while (!feof($fp2))
{
$cur_chunk = fread($fp2, 8192);
// Make sure nothing odd came through.
if (preg_match('~(iframe|\\<\\?php|\\<\\?[\s=]|\\<%[\s=]|html|eval|body|script\W)~', $prev_chunk . $cur_chunk) === 1)
{
fclose($fp2);
fclose($fp);
unlink($destName);
return false;
}
fwrite($fp, $cur_chunk);
$prev_chunk = $cur_chunk;
}
fclose($fp2);
// Walk the right path. if (!empty($modSettings['currentAttachmentUploadDir']))
// Walk the right path.
if (!empty($modSettings['currentAttachmentUploadDir']))
if (rename($destName . '.tmp', $avatar_hash === null ? $destName : $path . '/' . $attachID . '_' . $avatar_hash))
{
if (rename($destName . '.tmp', empty($avatar_hash) ? $destName : $path . '/' . $attachID . '_' . $avatar_hash))
{
$destName = empty($avatar_hash) ? $destName : $path . '/' . $attachID . '_' . $avatar_hash;
$destinationPath = $uploadDir . '/' . ($file_hash === null ? $destName : $cur_profile['id_attach'] . '_' . $file_hash);
if (!rename($_FILES['attachment']['tmp_name'], $destinationPath))
{
removeAttachments(array('id_member' => $memID));
fatal_lang_error('attach_timeout', 'critical');
}
// Attempt to chmod it.
@chmod($uploadDir . '/avatar_tmp_' . $memID, 0644);
// Attempt to chmod it.
@chmod($uploadDir . '/avatar_tmp_' . $memID, 0644);
if (preg_match('~(iframe|\\<\\?php|\\<\\?|\\<%|html|eval|body|script)~', fgets($fp, 4096)) === 1)
if (preg_match('~(iframe|\\<\\?php|\\<\\?[\s=]|\\<%[\s=]|html|eval|body|script\W)~', fgets($fp, 4096)) === 1)
fatal_lang_error('smf124');
fatal_lang_error('attach_timeout');
$mime_type = 'image/' . ($extension == 'jpg' ? 'jpeg' : $extension);
$mime_type = 'image/' . ($extension === 'jpg' ? 'jpeg' : ($extension === 'bmp' ? 'x-ms-bmp' : $extension));
$file_hash = empty($modSettings['custom_avatar_enabled']) ? getAttachmentFilename($destName, false, null, true) : null;
$file_hash = empty($modSettings['custom_avatar_enabled']) ? getAttachmentFilename($destName, false, null, true) : '';
// Remove previous attachments this member might have had.
removeAttachments(array('id_member' => $memID));
if (!rename($_FILES['attachment']['tmp_name'], $uploadDir . '/' . $destName))
fatal_lang_error('attach_timeout', 'critical');
// Remove previous attachments this member might have had.
removeAttachments(array('id_member' => $memID));
$destinationPath = $uploadDir . '/' . ($file_hash === null ? $destName : $cur_profile['id_attach'] . '_' . $file_hash);
$destinationPath = $uploadDir . '/' . (empty($file_hash) ? $destName : $cur_profile['id_attach'] . '_' . $file_hash);
// Does this have a mime type?
if ($mime_type && (isset($_REQUEST['image']) || !in_array($file_ext, array('jpg', 'gif', 'jpeg', 'x-ms-bmp', 'png', 'psd', 'tiff', 'iff'))))
header('Content-Type: ' . $mime_type);
// IE 6 just doesn't play nice. As dirty as this seems, it works.
if ($context['browser']['is_ie6'] && isset($_REQUEST['image']))
unset($_REQUEST['image']);
// Does this have a mime type?
elseif ($mime_type && (isset($_REQUEST['image']) || !in_array($file_ext, array('jpg', 'gif', 'jpeg', 'x-ms-bmp', 'png', 'psd', 'tiff', 'iff'))))
header('Content-Type: ' . strtr($mime_type, array('image/bmp' => 'image/x-ms-bmp')));
smf_2-0-RC1-1_validator.php |
This file should be able to execute standalone.
|