Skip to content

Commit

Permalink
clear notice, ref #1106
Browse files Browse the repository at this point in the history
  • Loading branch information
kcppdevelopers committed Apr 26, 2018
1 parent 17be144 commit 0ece4b5
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -875,11 +875,15 @@ public function angelleye_ajax_generate_cart() {
}
WC()->cart->calculate_totals();
}
if (ob_get_length()) ob_end_clean();
if (ob_get_length()) {
ob_end_clean();
}
ob_start();
wp_send_json(array('url' => $url));
} catch (Exception $ex) {
if (ob_get_length()) ob_end_clean();
if (ob_get_length()) {
ob_end_clean();
}
ob_start();
wp_send_json(array('url' => $url));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ public function angelleye_redirect() {
WC()->session->set('is_smart_button_popup_closed', 'yes');
wc_clear_notices();
if (!empty($_REQUEST['request_from']) && $_REQUEST['request_from'] == 'JSv4') {
if (ob_get_length()) ob_end_clean();
ob_start();
if (ob_get_length()) {
ob_end_clean();
}
ob_start();
wp_send_json(array(
'url' => $payPalURL
));
Expand All @@ -91,7 +93,9 @@ public function angelleye_redirect() {
$this->function_helper->ec_clear_session_data();
if (!is_ajax()) {
if (!empty($_REQUEST['request_from']) && $_REQUEST['request_from'] == 'JSv4') {
if (ob_get_length()) ob_end_clean();
if (ob_get_length()) {
ob_end_clean();
}
ob_start();
if (wc_notice_count('error') > 0) {
wp_send_json(array(
Expand All @@ -111,7 +115,9 @@ public function angelleye_redirect() {
}
} else {
if (!empty($_REQUEST['request_from']) && $_REQUEST['request_from'] == 'JSv4') {
if (ob_get_length()) ob_end_clean();
if (ob_get_length()) {
ob_end_clean();
}
ob_start();
wp_send_json(array(
'url' => $payPalURL
Expand All @@ -123,7 +129,9 @@ public function angelleye_redirect() {
'redirect' => get_permalink(wc_get_page_id('cart')),
);
if ($this->function_helper->ec_is_version_gte_2_4()) {
if (ob_get_length()) ob_end_clean();
if (ob_get_length()) {
ob_end_clean();
}
ob_start();
wp_send_json($args);
} else {
Expand All @@ -137,7 +145,9 @@ public function angelleye_redirect_action($url) {
if (!empty($url)) {

if (!empty($_REQUEST['request_from']) && $_REQUEST['request_from'] == 'JSv4') {
if (ob_get_length()) ob_end_clean();
if (ob_get_length()) {
ob_end_clean();
}
ob_start();
$query_str = parse_url($url, PHP_URL_QUERY);
parse_str($query_str, $query_params);
Expand All @@ -152,7 +162,9 @@ public function angelleye_redirect_action($url) {
wp_redirect($url);
exit;
} else {
if (ob_get_length()) ob_end_clean();
if (ob_get_length()) {
ob_end_clean();
}
ob_start();
$args = array(
'result' => 'success',
Expand Down Expand Up @@ -1486,8 +1498,10 @@ public function angelleye_wp_safe_redirect($url, $action = null) {
exit;
}
if (!empty($_REQUEST['request_from']) && $_REQUEST['request_from'] == 'JSv4') {
if (ob_get_length()) ob_end_clean();
ob_start();
if (ob_get_length()) {
ob_end_clean();
}
ob_start();
wp_send_json(array(
'url' => $url
));
Expand Down

0 comments on commit 0ece4b5

Please sign in to comment.