Changeset 12767 for trunk/picture.php


Ignore:
Timestamp:
Dec 19, 2011, 6:08:49 PM (12 years ago)
Author:
mistic100
Message:

feature:2538 transmits messages after comment edition trough SESSION (no more ugly url displayed, avoid some minor bugs)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/picture.php

    r12764 r12767  
    321321      check_input_parameter('comment_to_edit', $_GET, false, PATTERN_ID);
    322322      $author_id = get_comment_author_id($_GET['comment_to_edit']);
     323     
    323324      if (can_manage_comment('edit', $author_id))
    324325      {
     
    334335            );
    335336
     337          $perform_redirect = false;
    336338          switch ($comment_action)
    337339          {
    338340            case 'moderate':
    339               array_push($page['infos'], l10n('An administrator must authorize your comment before it is visible.'));
     341              $_SESSION['page_infos'][] = l10n('An administrator must authorize your comment before it is visible.');
    340342            case 'validate':
    341               array_push($page['infos'], l10n('Your comment has been registered'));
     343              $_SESSION['page_infos'][] = l10n('Your comment has been registered');
     344              $perform_redirect = true;
    342345              break;
    343346            case 'reject':
    344               set_status_header(403);
    345               array_push($page['errors'], l10n('Your comment has NOT been registered because it did not pass the validation rules'));
     347              $_SESSION['page_errors'][] = l10n('Your comment has NOT been registered because it did not pass the validation rules');
     348              $perform_redirect = true;
    346349              break;
    347350            default:
    348351              trigger_error('Invalid comment action '.$comment_action, E_USER_WARNING);
    349352          }
    350            
     353         
     354          if ($perform_redirect)
     355          {
     356            redirect($url_self);
     357          }
    351358          unset($_POST['content']);
    352359          break;
Note: See TracChangeset for help on using the changeset viewer.