1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-10 09:35:24 +02:00

cross-checkin for the TRUNK

git-svn-id: file:///svn/phpbb/trunk@8333 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Henry Sudhof 2008-01-23 14:32:15 +00:00
parent e6991260df
commit 7fed5dd166
5 changed files with 47 additions and 20 deletions

View File

@ -102,6 +102,8 @@
<li>[Fix] Check entered imagemagick path for trailing slash (Bug #18205)</li> <li>[Fix] Check entered imagemagick path for trailing slash (Bug #18205)</li>
<li>[Fix] Use proper title on index for new/unread posts (Bug #13101) - patch provided by Pyramide</li> <li>[Fix] Use proper title on index for new/unread posts (Bug #13101) - patch provided by Pyramide</li>
<li>[Fix] Allow calls to $user->set_cookie() define no cookie time for setting session cookies (Bug #18025)</li> <li>[Fix] Allow calls to $user->set_cookie() define no cookie time for setting session cookies (Bug #18025)</li>
<li>[Fix] Stricter checks on smilie packs (Bug #19675)</li>
<li>[Fix] Gracefully return from cancelling pm drafts (Bug #19675)</li>
</ul> </ul>
<a name="v30rc8"></a><h3>1.i. Changes since 3.0.RC8</h3> <a name="v30rc8"></a><h3>1.i. Changes since 3.0.RC8</h3>

View File

@ -337,11 +337,16 @@ class acp_icons
} }
$icons_updated = 0; $icons_updated = 0;
$errors = array();
foreach ($images as $image) foreach ($images as $image)
{ {
if (($mode == 'smilies' && ($image_emotion[$image] == '' || $image_code[$image] == '')) || if ($mode == 'smilies' && ($image_emotion[$image] == '' || $image_code[$image] == ''))
($action == 'create' && !isset($image_add[$image])))
{ {
$errors[$image] = 'SMILIE_NO_' . (($image_emotion[$image] == '') ? 'EMOTION' : 'CODE');
}
else if ($action == 'create' && !isset($image_add[$image]))
{
// skip images where add wasn't checked
} }
else else
{ {
@ -431,13 +436,18 @@ class acp_icons
default: default:
$suc_lang = $lang; $suc_lang = $lang;
} }
$errormsgs = '<br />';
foreach ($errors as $img => $error)
{
$errormsgs .= '<br />' . sprintf($user->lang[$error], $img);
}
if ($action == 'modify') if ($action == 'modify')
{ {
trigger_error($user->lang[$suc_lang . '_EDITED'] . adm_back_link($this->u_action), $level); trigger_error($user->lang[$suc_lang . '_EDITED'] . $errormsgs . adm_back_link($this->u_action), $level);
} }
else else
{ {
trigger_error($user->lang[$suc_lang . '_ADDED'] . adm_back_link($this->u_action), $level); trigger_error($user->lang[$suc_lang . '_ADDED'] . $errormsgs .adm_back_link($this->u_action), $level);
} }
break; break;
@ -462,7 +472,7 @@ class acp_icons
if (preg_match_all("#'(.*?)', ?#", $pak_entry, $data)) if (preg_match_all("#'(.*?)', ?#", $pak_entry, $data))
{ {
if ((sizeof($data[1]) != 4 && $mode == 'icons') || if ((sizeof($data[1]) != 4 && $mode == 'icons') ||
(sizeof($data[1]) != 6 && $mode == 'smilies')) ((sizeof($data[1]) != 6 || (empty($data[1][4]) || empty($data[1][5]))) && $mode == 'smilies' ))
{ {
trigger_error($user->lang['WRONG_PAK_TYPE'] . adm_back_link($this->u_action), E_USER_WARNING); trigger_error($user->lang['WRONG_PAK_TYPE'] . adm_back_link($this->u_action), E_USER_WARNING);
} }

View File

@ -465,7 +465,8 @@ function compose_pm($id, $mode, $action)
'forum_id' => 0, 'forum_id' => 0,
'save_time' => $current_time, 'save_time' => $current_time,
'draft_subject' => $subject, 'draft_subject' => $subject,
'draft_message' => $message) 'draft_message' => $message
)
); );
$db->sql_query($sql); $db->sql_query($sql);
@ -488,6 +489,8 @@ function compose_pm($id, $mode, $action)
'g' => $to_group_id, 'g' => $to_group_id,
'p' => $msg_id) 'p' => $msg_id)
); );
$s_hidden_fields .= build_address_field($address_list);
confirm_box(false, 'SAVE_DRAFT', $s_hidden_fields); confirm_box(false, 'SAVE_DRAFT', $s_hidden_fields);
} }
@ -541,7 +544,7 @@ function compose_pm($id, $mode, $action)
if ($submit || $preview || $refresh) if ($submit || $preview || $refresh)
{ {
if (!check_form_key('ucp_pm_compose')) if (($submit || $preview) && !check_form_key('ucp_pm_compose'))
{ {
$error[] = $user->lang['FORM_INVALID']; $error[] = $user->lang['FORM_INVALID'];
} }
@ -888,15 +891,9 @@ function compose_pm($id, $mode, $action)
} }
// Build hidden address list // Build hidden address list
$s_hidden_address_field = ''; $s_hidden_address_field = build_address_field($address_list);
foreach ($address_list as $type => $adr_ary)
{
foreach ($adr_ary as $id => $field)
{
$s_hidden_address_field .= '<input type="hidden" name="address_list[' . (($type == 'u') ? 'u' : 'g') . '][' . (int) $id . ']" value="' . (($field == 'to') ? 'to' : 'bcc') . '" />';
}
}
$bbcode_checked = (isset($enable_bbcode)) ? !$enable_bbcode : (($config['allow_bbcode'] && $auth->acl_get('u_pm_bbcode')) ? !$user->optionget('bbcode') : 1); $bbcode_checked = (isset($enable_bbcode)) ? !$enable_bbcode : (($config['allow_bbcode'] && $auth->acl_get('u_pm_bbcode')) ? !$user->optionget('bbcode') : 1);
$smilies_checked = (isset($enable_smilies)) ? !$enable_smilies : (($config['allow_smilies'] && $auth->acl_get('u_pm_smilies')) ? !$user->optionget('smilies') : 1); $smilies_checked = (isset($enable_smilies)) ? !$enable_smilies : (($config['allow_smilies'] && $auth->acl_get('u_pm_smilies')) ? !$user->optionget('smilies') : 1);
$urls_checked = (isset($enable_urls)) ? !$enable_urls : 0; $urls_checked = (isset($enable_urls)) ? !$enable_urls : 0;
@ -1117,6 +1114,22 @@ function handle_message_list_actions(&$address_list, &$error, $remove_u, $remove
} }
} }
/**
* Build the hidden field for the recipients. Needed, as the variable is not read via request_var.
*/
function build_address_field($address_list)
{
$s_hidden_address_field = '';
foreach ($address_list as $type => $adr_ary)
{
foreach ($adr_ary as $id => $field)
{
$s_hidden_address_field .= '<input type="hidden" name="address_list[' . (($type == 'u') ? 'u' : 'g') . '][' . (int) $id . ']" value="' . (($field == 'to') ? 'to' : 'bcc') . '" />';
}
}
return $s_hidden_address_field;
}
/** /**
* Return number of private message recipients * Return number of private message recipients
*/ */

View File

@ -162,6 +162,8 @@ $lang = array_merge($lang, array(
'SMILIES_CONFIG' => 'Smiley configuration', 'SMILIES_CONFIG' => 'Smiley configuration',
'SMILIES_DELETED' => 'The smiley has been removed successfully.', 'SMILIES_DELETED' => 'The smiley has been removed successfully.',
'SMILIES_EDIT' => 'Edit smiley', 'SMILIES_EDIT' => 'Edit smiley',
'SMILIE_NO_CODE' => 'The smilie “%s” was ignored, as there was no code entered.',
'SMILIE_NO_EMOTION' => 'The smilie “%s” was ignored, as there was no emotion entered.',
'SMILIES_NONE_EDITED' => 'No smilies were updated.', 'SMILIES_NONE_EDITED' => 'No smilies were updated.',
'SMILIES_ONE_EDITED' => 'The smiley has been updated successfully.', 'SMILIES_ONE_EDITED' => 'The smiley has been updated successfully.',
'SMILIES_EDITED' => 'The smilies have been updated successfully.', 'SMILIES_EDITED' => 'The smilies have been updated successfully.',

View File

@ -382,13 +382,14 @@
<!-- IF S_SAVE_ALLOWED -->&nbsp; <input class="btnlite" type="submit" accesskey="k" tabindex="12" name="save" value="{L_SAVE}" /><!-- ENDIF --> <!-- IF S_SAVE_ALLOWED -->&nbsp; <input class="btnlite" type="submit" accesskey="k" tabindex="12" name="save" value="{L_SAVE}" /><!-- ENDIF -->
<!-- IF S_HAS_DRAFTS -->&nbsp; <input class="btnlite" type="submit" accesskey="d" tabindex="13" name="load" value="{L_LOAD}" /><!-- ENDIF --> <!-- IF S_HAS_DRAFTS -->&nbsp; <input class="btnlite" type="submit" accesskey="d" tabindex="13" name="load" value="{L_LOAD}" /><!-- ENDIF -->
<!-- ENDIF --> <!-- ENDIF -->
&nbsp; <input class="btnlite" type="submit" accesskey="c" tabindex="14" name="cancel" value="{L_CANCEL}" /> &nbsp; <input class="btnlite" type="submit" accesskey="c" tabindex="14" name="cancel" value="{L_CANCEL}" />{S_FORM_TOKEN}
</td> </td>
</tr> </tr>
</table> </table>
<br clear="all" /> <br clear="all" />
</form>
<!-- IF S_DISPLAY_REVIEW --><!-- INCLUDE posting_topic_review.html --><!-- ENDIF --> <!-- IF S_DISPLAY_REVIEW --><!-- INCLUDE posting_topic_review.html --><!-- ENDIF -->
<!-- IF S_DISPLAY_HISTORY --><!-- INCLUDE ucp_pm_history.html --><!-- ENDIF --> <!-- IF S_DISPLAY_HISTORY --><!-- INCLUDE ucp_pm_history.html --><!-- ENDIF -->
@ -397,8 +398,7 @@
<!-- ELSE --> <!-- ELSE -->
<!-- INCLUDE breadcrumbs.html --> <!-- INCLUDE breadcrumbs.html -->
{S_FORM_TOKEN}
</form>
<!-- IF S_DISPLAY_ONLINE_LIST --> <!-- IF S_DISPLAY_ONLINE_LIST -->
<br clear="all" /> <br clear="all" />