Permalink
Browse files

Switch for imap_base64. Fixes #9

  • Loading branch information...
1 parent f332767 commit 346a144edccc5c2e592b6404f86aa005f06d3fad @boonebgorges committed Jan 2, 2011
Showing with 6 additions and 2 deletions.
  1. +6 −2 bp-group-reviews.php
View
@@ -104,8 +104,12 @@ function setup_current_group_globals() {
function grab_cookie() {
global $bp;
- if ( empty( $bp->group_reviews->previous_data ) && isset( $_COOKIE['bpgr-data'] ) )
- $bp->group_reviews->previous_data = maybe_unserialize( imap_base64 ( $_COOKIE['bpgr-data'] ) );
+ if ( empty( $bp->group_reviews->previous_data ) && isset( $_COOKIE['bpgr-data'] ) ) {
+ if ( function_exists( 'imap_base64' ) )
+ $bp->group_reviews->previous_data = maybe_unserialize( imap_base64 ( $_COOKIE['bpgr-data'] ) );
+ else if ( function_exists( 'base64_encode' ) )
+ $bp->group_reviews->previous_data = maybe_unserialize( base64_encode ( $_COOKIE['bpgr-data'] ) );
+ }
@setcookie( 'bpgr-data', false, time() - 1000, COOKIEPATH );
}

0 comments on commit 346a144

Please sign in to comment.