PRGredirect/Modules/Core/Utils_PRGredirect.php

43 lines
1.0 KiB
PHP
Raw Normal View History

2022-07-25 10:23:03 +02:00
<?php
/**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
declare(strict_types=1);
namespace D3\PRGredirects\Modules\Core;
2022-07-26 21:49:58 +02:00
use OxidEsales\Eshop\Core\Exception\StandardException;
2022-07-25 10:23:03 +02:00
use OxidEsales\Eshop\Core\Registry;
class Utils_PRGredirect extends Utils_PRGredirect_parent
{
2022-07-26 21:49:58 +02:00
/**
* @param string $url
* @return void
*/
public function d3PrgRedirect(string $url): void
2022-07-25 10:23:03 +02:00
{
2022-07-25 13:44:17 +02:00
$url = str_ireplace("&amp;", "&", $url);
2022-07-25 10:23:03 +02:00
$headerCode = "HTTP/1.1 303 See Other";
try {
$this->_simpleRedirect($url, $headerCode);
Registry::getSession()->freeze();
2022-07-26 21:49:58 +02:00
} catch (StandardException $e) {
2022-07-25 10:23:03 +02:00
$e->debugOut();
}
$this->showMessageAndExit('');
}
2022-07-25 13:44:17 +02:00
}