Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Renaming] Handle crash on RenameFunctionRector with die() and $_SESS…
…ION usage (#5646) * [Renaming] Handle crash on RenameFunctionRector with die() and $_SESSION usage * Fix * fix
- Loading branch information
1 parent
29562ce
commit 00876da
Showing
3 changed files
with
86 additions
and
5 deletions.
There are no files selected for viewing
65 changes: 65 additions & 0 deletions
65
...-tests/Renaming/Rector/FuncCall/RenameFunctionRector/Fixture/with_die_and_session.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?php | ||
|
||
if ($_SESSION['order_in_progress'] != 1) { | ||
$isNewUIEnabled = true; | ||
|
||
if ($isNewUIEnabled) { | ||
if ( | ||
isset($deliveryRequestResponse) && | ||
!preg_match('/^Error/m', $deliveryRequestResponse) && | ||
!empty($deliveryRequestResponse->delivery_tracking_url) | ||
) { | ||
$trackingUrl = $deliveryRequestResponse->delivery_tracking_url; | ||
$_SESSION['checkout_success_tracking_url'] = $trackingUrl; | ||
} | ||
return; | ||
} | ||
} else { | ||
die('Sorry, this order may already have been placed. If you did not receive a confirmation email, please give us a call to confirm your order.'); | ||
} | ||
|
||
function insertorder() | ||
{ | ||
|
||
$result = abc(''); | ||
if (!$result) { | ||
die(abc2()); | ||
} | ||
} | ||
|
||
unset($_SESSION['cart']); | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
if ($_SESSION['order_in_progress'] != 1) { | ||
$isNewUIEnabled = true; | ||
|
||
if ($isNewUIEnabled) { | ||
if ( | ||
isset($deliveryRequestResponse) && | ||
!preg_match('/^Error/m', $deliveryRequestResponse) && | ||
!empty($deliveryRequestResponse->delivery_tracking_url) | ||
) { | ||
$trackingUrl = $deliveryRequestResponse->delivery_tracking_url; | ||
$_SESSION['checkout_success_tracking_url'] = $trackingUrl; | ||
} | ||
return; | ||
} | ||
} else { | ||
die('Sorry, this order may already have been placed. If you did not receive a confirmation email, please give us a call to confirm your order.'); | ||
} | ||
|
||
function insertorder() | ||
{ | ||
|
||
$result = abc(''); | ||
if (!$result) { | ||
die(abc()); | ||
} | ||
} | ||
|
||
unset($_SESSION['cart']); | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters