Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Refactored to use bit_redirect for page switch

  • Loading branch information...
commit f2111ae9d6aeb30c9403d1b25228be62812bc97c 1 parent 5f3d88c
Lester Caine authored August 08, 2012
5  edit.php
@@ -62,11 +62,10 @@
62 62
 	if( empty( $_REQUEST['topic_id'] ) ) $_REQUEST['topic_id'] = 0;
63 63
 	if( $gContent->store( $_REQUEST ) ) {
64 64
 		if( isset ($gContent->mInfo['status_id']) and $gContent->mInfo['status_id'] == ARTICLE_STATUS_PENDING ) {
65  
-			header ( "Location: " . ARTICLES_PKG_URL. "index.php?feedback=".urlencode( tra( 'Your article has been submitted and is awaiting approval.' ) ) );
  65
+			bit_redirect( ARTICLES_PKG_URL. "index.php?feedback=".urlencode( tra( 'Your article has been submitted and is awaiting approval.' ) ) );
66 66
 		} else {
67  
-			header ( "Location: " . ARTICLES_PKG_URL . ( ($gBitSystem->isFeatureActive('pretty_urls_extended') || $gBitSystem->isFeatureActive('pretty_urls')) ? $gContent->mArticleId : "read.php?article_id=" . $gContent->mArticleId ) );
  67
+			bit_redirect( ARTICLES_PKG_URL . ( ($gBitSystem->isFeatureActive('pretty_urls_extended') || $gBitSystem->isFeatureActive('pretty_urls')) ? $gContent->mArticleId : "read.php?article_id=" . $gContent->mArticleId ) );
68 68
 		}
69  
-		die;
70 69
 	}
71 70
 }
72 71
 
3  edit_topic.php
@@ -30,8 +30,7 @@
30 30
 if( isset( $_REQUEST["fSubmitSaveTopic"] ) ) {
31 31
     $gContent->storeTopic( $_REQUEST );
32 32
 	$gContent->loadTopic();
33  
-    header( "Location: " . ARTICLES_PKG_URL . "admin/admin_topics.php" );
34  
-    die;
  33
+    bit_redirect(( ARTICLES_PKG_URL . "admin/admin_topics.php" );
35 34
 } elseif( isset( $_REQUEST['fRemoveTopicImage'] ) ) {
36 35
 	$gContent->removeTopicImage();
37 36
 }
3  index.php
@@ -16,8 +16,7 @@
16 16
 
17 17
 if( !empty( $_REQUEST['article_id'] ) ) {
18 18
 	$param = array ( 'article_id' => ( int )$_REQUEST['article_id'] );
19  
-	header( "Location: ".BitArticle::getDisplayUrlFromHash( $param ) );
20  
-	die;
  19
+	bit_redirect( BitArticle::getDisplayUrlFromHash( $param ) );
21 20
 }
22 21
 
23 22
 // Display the template
3  list.php
@@ -36,8 +36,7 @@
36 36
 
37 37
 		if( isset( $_REQUEST["confirm"] ) ) {
38 38
 			if( $tmpArt->expunge() ) {
39  
-				header( "Location: ".ARTICLES_PKG_URL.'list.php?status_id='.( !empty( $_REQUEST['status_id'] ) ? $_REQUEST['status_id'] : '' ) );
40  
-				die;
  39
+				bit_redirect( ARTICLES_PKG_URL.'list.php?status_id='.( !empty( $_REQUEST['status_id'] ) ? $_REQUEST['status_id'] : '' ) );
41 40
 			} else {
42 41
 				$feedback['error'] = $tmpArt->mErrors;
43 42
 			}

0 notes on commit f2111ae

Please sign in to comment.
Something went wrong with that request. Please try again.