Dotclear


Ignore:
Timestamp:
10/09/13 09:30:33 (12 years ago)
Author:
Nicolas <nikrou77@…>
Branch:
default
Children:
2322:a75984c93a86, 2406:325f49056c79
Message:

Fix invalid html for media page (in attachment context) because of nested form.
Closes #1761

File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin/post_media.php

    r2256 r2320  
    2727 
    2828try { 
    29      if ($post_id && $media_id && !empty($_POST['attach'])) 
     29     if ($post_id && $media_id && !empty($_REQUEST['attach'])) 
    3030     { 
    3131          $core->media = new dcMedia($core); 
    3232          $core->media->addPostMedia($post_id,$media_id); 
    33           http::redirect($core->getPostAdminURL($rs->post_type,$post_id,false)); 
     33        if (!empty($_SERVER['HTTP_X_REQUESTED_WITH'])) { 
     34            header('Content-type: application/json'); 
     35            echo json_encode(array('url' => $core->getPostAdminURL($rs->post_type,$post_id,false))); 
     36            exit(); 
     37        } else { 
     38            http::redirect($core->getPostAdminURL($rs->post_type,$post_id,false)); 
     39        } 
    3440     } 
    3541 
     
    7985     } 
    8086} 
    81 ?> 
Note: See TracChangeset for help on using the changeset viewer.

Sites map