diff -r d52dfa1f08da -r 323c4cd1aa37 plugins/SpecialUpdownload.php --- a/plugins/SpecialUpdownload.php Mon May 04 23:07:00 2009 -0400 +++ b/plugins/SpecialUpdownload.php Tue May 05 00:10:26 2009 -0400 @@ -101,17 +101,16 @@ } } - if ( isset ( $paths->pages[ $paths->nslist['File'] . $filename ] ) && !isset ( $_POST['update'] ) ) + $ns = namespace_factory($filename, 'File'); + $cdata = $ns->get_cdata(); + $is_protected = $cdata['really_protected']; + + if ( isPage($paths->get_pathskey($filename, 'File')) && !isset ( $_POST['update'] ) ) { $upload_link = makeUrlNS('Special', 'UploadFile/'.$filename); die_friendly($lang->get('upload_err_title'), '
' . $lang->get('upload_err_already_exists', array('upload_link' => $upload_link)) . '
'); } - else if ( isset($_POST['update']) && - ( !isset($paths->pages[$paths->nslist['File'].$filename]) || - (isset($paths->pages[$paths->nslist['File'].$filename]) && - $paths->pages[$paths->nslist['File'].$filename]['protected'] == 1 ) - ) - ) + else if ( isset($_POST['update']) && $is_protected ) { die_friendly($lang->get('upload_err_title'), '' . $lang->get('upload_err_replace_protected') . '
'); }