Adjust order of error message and redirect when using rx_ajax

This commit is contained in:
Kijin Sung 2019-12-03 13:41:38 +09:00
parent 069d09c20f
commit 4ed6445d9b

View file

@ -943,18 +943,18 @@ class ModuleHandler extends Handler
// Handle iframe form submissions.
if(isset($_POST['_rx_target_iframe']) && starts_with('_rx_temp_', $_POST['_rx_target_iframe']))
{
if($this->error && $this->error !== 'success')
{
ob_end_clean();
echo sprintf('<html><head></head><body><script> window.parent.alert(%s); window.parent.remove_iframe(%s); </script></body></html>', json_encode($this->error), json_encode($_POST['_rx_target_iframe']));
return;
}
if($_SESSION['XE_VALIDATOR_RETURN_URL'])
{
ob_end_clean();
echo sprintf('<html><head></head><body><script> window.parent.redirect(%s); </script></body></html>', json_encode($_SESSION['XE_VALIDATOR_RETURN_URL']));
return;
}
if($this->error)
{
ob_end_clean();
echo sprintf('<html><head></head><body><script> window.parent.alert(%s); window.parent.remove_iframe(%s); </script></body></html>', json_encode($this->error), json_encode($_POST['_rx_target_iframe']));
return;
}
}
// Handle redirects.