Skip to content

Commit

Permalink
Deprecate print_successful_redirect*()
Browse files Browse the repository at this point in the history
Fixes #5189
  • Loading branch information
vboctor committed Sep 7, 2023
1 parent 4a20beb commit bcec5bc
Show file tree
Hide file tree
Showing 27 changed files with 30 additions and 45 deletions.
2 changes: 1 addition & 1 deletion account_prefs_update.php
Expand Up @@ -139,5 +139,5 @@

form_security_purge( 'account_prefs_update' );

print_successful_redirect( $f_redirect_url, /* force_show */ true );
print_header_redirect( $f_redirect_url, /* force_show */ true );

2 changes: 1 addition & 1 deletion adm_config_delete.php
Expand Up @@ -66,5 +66,5 @@

form_security_purge( 'adm_config_delete' );

print_successful_redirect( 'adm_config_report.php' );
print_header_redirect( 'adm_config_report.php' );

2 changes: 1 addition & 1 deletion adm_config_set.php
Expand Up @@ -121,4 +121,4 @@

form_security_purge( 'adm_config_set' );

print_successful_redirect( 'adm_config_report.php' );
print_header_redirect( 'adm_config_report.php' );
2 changes: 1 addition & 1 deletion bug_monitor_add.php
Expand Up @@ -66,4 +66,4 @@

form_security_purge( 'bug_monitor_add' );

print_successful_redirect_to_bug( $f_bug_id );
print_header_redirect_view( $f_bug_id );
2 changes: 1 addition & 1 deletion bug_monitor_delete.php
Expand Up @@ -84,4 +84,4 @@

form_security_purge( 'bug_monitor_delete' );

print_successful_redirect_to_bug( $f_bug_id );
print_header_redirect_view( $f_bug_id );
2 changes: 1 addition & 1 deletion bug_revision_drop.php
Expand Up @@ -54,5 +54,5 @@
bug_revision_drop( $f_revision_id );
form_security_purge( 'bug_revision_drop' );

print_successful_redirect_to_bug( $t_revision['bug_id'] );
print_header_redirect_view( $t_revision['bug_id'] );

2 changes: 1 addition & 1 deletion bug_stick.php
Expand Up @@ -59,4 +59,4 @@

form_security_purge( 'bug_stick' );

print_successful_redirect_to_bug( $f_bug_id );
print_header_redirect_view( $f_bug_id );
2 changes: 1 addition & 1 deletion bug_update.php
Expand Up @@ -509,4 +509,4 @@ function get_valid_version( BugData $p_bug, $p_field ) {

form_security_purge( 'bug_update' );

print_successful_redirect_to_bug( $f_bug_id );
print_header_redirect_view( $f_bug_id );
2 changes: 1 addition & 1 deletion bugnote_add.php
Expand Up @@ -65,4 +65,4 @@

form_security_purge( 'bugnote_add' );

print_successful_redirect_to_bug( $f_bug_id );
print_header_redirect_view( $f_bug_id );
2 changes: 1 addition & 1 deletion bugnote_delete.php
Expand Up @@ -50,4 +50,4 @@

form_security_purge( 'bugnote_delete' );

print_successful_redirect( string_get_bug_view_url( $t_result['issue_id'] ) . '#bugnotes' );
print_header_redirect( string_get_bug_view_url( $t_result['issue_id'] ) . '#bugnotes' );
2 changes: 1 addition & 1 deletion bugnote_set_view_state.php
Expand Up @@ -87,4 +87,4 @@

form_security_purge( 'bugnote_set_view_state' );

print_successful_redirect( string_get_bug_view_url( $t_bug_id ) . '#bugnotes' );
print_header_redirect( string_get_bug_view_url( $t_bug_id ) . '#bugnotes' );
2 changes: 1 addition & 1 deletion bugnote_update.php
Expand Up @@ -90,4 +90,4 @@

form_security_purge( 'bugnote_update' );

print_successful_redirect( string_get_bugnote_view_url( $t_bug_id, $f_bugnote_id ) );
print_header_redirect( string_get_bugnote_view_url( $t_bug_id, $f_bugnote_id ) );
17 changes: 4 additions & 13 deletions core/print_api.php
Expand Up @@ -151,11 +151,11 @@ function print_header_redirect_view( $p_bug_id ) {
*
* @param integer $p_bug_id A bug identifier.
* @return void
* @deprecated Use print_header_redirect() instead.
*/
function print_successful_redirect_to_bug( $p_bug_id ) {
$t_url = string_get_bug_view_url( $p_bug_id );

print_successful_redirect( $t_url );
print_header_redirect( $t_url );
}

/**
Expand All @@ -165,19 +165,10 @@ function print_successful_redirect_to_bug( $p_bug_id ) {
* @param string $p_redirect_to URI to redirect to.
* @param bool $p_force_show Force showing operation successful
* @return void
* @deprecated Use print_header_redirect() instead.
*/
function print_successful_redirect( $p_redirect_to, $p_force_show = false ) {
if( $p_force_show || helper_log_to_page() ) {
layout_page_header( null, $p_redirect_to );
layout_page_begin();
echo '<br /><div class="center">';
echo lang_get( 'operation_successful' ) . '<br />';
print_link_button( $p_redirect_to, lang_get( 'proceed' ) );
echo '</div>';
layout_page_end();
} else {
print_header_redirect( $p_redirect_to );
}
print_header_redirect( $p_redirect_to );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion docbook/Developers_Guide/en-US/Plugins_Building.xml
Expand Up @@ -706,7 +706,7 @@ if( $f_reset ) {
trigger_error( ERROR_CONFIG_OPT_INVALID, ERROR );
}
print_successful_redirect( plugin_page( 'config', true ) );
print_header_redirect( plugin_page( 'config', true ) );
]]>
</programlisting>

Expand Down
2 changes: 1 addition & 1 deletion manage_plugin_install.php
Expand Up @@ -57,4 +57,4 @@

form_security_purge( 'manage_plugin_install' );

print_successful_redirect( 'manage_plugin_page.php' );
print_header_redirect( 'manage_plugin_page.php' );
2 changes: 1 addition & 1 deletion manage_plugin_uninstall.php
Expand Up @@ -81,4 +81,4 @@

form_security_purge( 'manage_plugin_uninstall' );

print_successful_redirect( 'manage_plugin_page.php' );
print_header_redirect( 'manage_plugin_page.php' );
2 changes: 1 addition & 1 deletion manage_plugin_update.php
Expand Up @@ -79,4 +79,4 @@

form_security_purge( 'manage_plugin_update' );

print_successful_redirect( 'manage_plugin_page.php' );
print_header_redirect( 'manage_plugin_page.php' );
2 changes: 1 addition & 1 deletion manage_proj_update_children.php
Expand Up @@ -67,4 +67,4 @@

form_security_purge( 'manage_proj_update_children' );

print_successful_redirect( 'manage_proj_edit_page.php?project_id=' . $f_project_id . '#subprojects');
print_header_redirect( 'manage_proj_edit_page.php?project_id=' . $f_project_id . '#subprojects' );
2 changes: 1 addition & 1 deletion manage_proj_ver_add.php
Expand Up @@ -100,4 +100,4 @@
$t_redirect_url = 'manage_proj_edit_page.php?project_id=' . $f_project_id . '#versions';
}

print_successful_redirect( $t_redirect_url );
print_header_redirect( $t_redirect_url );
4 changes: 1 addition & 3 deletions manage_user_create.php
Expand Up @@ -99,15 +99,13 @@
$t_redirect_url = 'manage_user_edit_page.php?user_id=' . $t_user_id;

layout_page_header( null, $t_redirect_url );

layout_page_begin( 'manage_overview_page.php' );

$t_access_level = get_enum_element( 'access_levels', $f_access_level );
$t_message = lang_get( 'created_user_part1' )
. ' <span class="bold">' . $f_username . '</span> '
. lang_get( 'created_user_part2' )
. ' <span class="bold">' . $t_access_level . '</span><br />';
html_operation_successful( $t_redirect_url, $t_message );

echo '</div>';

layout_page_end();
5 changes: 0 additions & 5 deletions news_add.php
Expand Up @@ -65,12 +65,7 @@
$t_news_row = news_get_row( $t_news_id );

layout_page_header();

layout_page_begin( 'main_page.php' );

echo '<div class="space-10"></div>';
html_operation_successful( 'main_page.php' );

print_news_entry_from_row( $t_news_row );

layout_page_end();
2 changes: 1 addition & 1 deletion plugins/MantisCoreFormatting/pages/config_edit.php
Expand Up @@ -50,4 +50,4 @@

form_security_purge( 'plugin_format_config_edit' );

print_successful_redirect( plugin_page( 'config', true ) );
print_header_redirect( plugin_page( 'config', true ) );
3 changes: 2 additions & 1 deletion tag_attach.php
Expand Up @@ -78,4 +78,5 @@
$t_command->execute();

form_security_purge( 'tag_attach' );
print_successful_redirect_to_bug( $f_bug_id );

print_header_redirect_view( $f_bug_id );
2 changes: 1 addition & 1 deletion tag_create.php
Expand Up @@ -59,5 +59,5 @@
}

form_security_purge( 'tag_create' );
print_successful_redirect( 'manage_tags_page.php' );

print_header_redirect( 'manage_tags_page.php' );
2 changes: 1 addition & 1 deletion tag_delete.php
Expand Up @@ -56,4 +56,4 @@

form_security_purge( 'tag_delete' );

print_successful_redirect( 'manage_tags_page.php' );
print_header_redirect( 'manage_tags_page.php' );
2 changes: 1 addition & 1 deletion tag_detach.php
Expand Up @@ -48,4 +48,4 @@

form_security_purge( 'tag_detach' );

print_successful_redirect_to_bug( $f_bug_id );
print_header_redirect_view( $f_bug_id );
2 changes: 1 addition & 1 deletion tag_update.php
Expand Up @@ -72,4 +72,4 @@
form_security_purge( 'tag_update' );

$t_url = 'tag_view_page.php?tag_id='.$f_tag_id;
print_successful_redirect( $t_url );
print_header_redirect( $t_url );

0 comments on commit bcec5bc

Please sign in to comment.