plugins/SpecialUpdownload.php
changeset 953 323c4cd1aa37
parent 898 c75754f5b1da
child 960 e74741b8360b
equal deleted inserted replaced
952:d52dfa1f08da 953:323c4cd1aa37
    99       {
    99       {
   100         die_friendly($lang->get('upload_err_title'), '<p>' . $lang->get('upload_err_banned_chars') . '</p>');
   100         die_friendly($lang->get('upload_err_title'), '<p>' . $lang->get('upload_err_banned_chars') . '</p>');
   101       }
   101       }
   102     }
   102     }
   103     
   103     
   104     if ( isset ( $paths->pages[ $paths->nslist['File'] . $filename ] ) && !isset ( $_POST['update'] ) )
   104     $ns = namespace_factory($filename, 'File');
       
   105     $cdata = $ns->get_cdata();
       
   106     $is_protected = $cdata['really_protected'];
       
   107     
       
   108     if ( isPage($paths->get_pathskey($filename, 'File')) && !isset ( $_POST['update'] ) )
   105     {
   109     {
   106       $upload_link = makeUrlNS('Special', 'UploadFile/'.$filename);
   110       $upload_link = makeUrlNS('Special', 'UploadFile/'.$filename);
   107       die_friendly($lang->get('upload_err_title'), '<p>' . $lang->get('upload_err_already_exists', array('upload_link' => $upload_link)) . '</p>');
   111       die_friendly($lang->get('upload_err_title'), '<p>' . $lang->get('upload_err_already_exists', array('upload_link' => $upload_link)) . '</p>');
   108     }
   112     }
   109     else if ( isset($_POST['update']) && 
   113     else if ( isset($_POST['update']) && $is_protected )
   110             ( !isset($paths->pages[$paths->nslist['File'].$filename]) ||
       
   111              (isset($paths->pages[$paths->nslist['File'].$filename]) &&
       
   112                $paths->pages[$paths->nslist['File'].$filename]['protected'] == 1 )
       
   113              )
       
   114            )
       
   115     {
   114     {
   116       die_friendly($lang->get('upload_err_title'), '<p>' . $lang->get('upload_err_replace_protected') . '</p>');
   115       die_friendly($lang->get('upload_err_title'), '<p>' . $lang->get('upload_err_replace_protected') . '</p>');
   117     }
   116     }
   118     
   117     
   119     $utime = time();
   118     $utime = time();