| Server IP : 85.158.181.41 / Your IP : 216.73.217.12 Web Server : Apache System : Linux cloud9-vm129 6.1.178+1-ph #ph SMP PREEMPT_DYNAMIC Wed Jul 29 09:00:54 UTC 2026 x86_64 User : moncbefd ( 1024) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/moncbefd/www.moneta.at/system/classes/external/paypal3/ |
Upload File : |
<?php
/* --------------------------------------------------------------
PayPalEncodingHelper.inc.php 2015-04-27
Gambio GmbH
http://www.gambio.de
Copyright (c) 2015 Gambio GmbH
Released under the GNU General Public License (Version 2)
[http://www.gnu.org/licenses/gpl-2.0.html]
--------------------------------------------------------------
*/
/**
* wrapper class to handle differences in encoding between PayPal and shop system.
* Only really necessary for backwards compatibility with pre-UTF-8 versions (GX 2.0.x).
*/
class PayPalEncodingHelper
{
/**
* @var bool $transcodingRequired flag indicating whether conversion is necessary
*/
protected $transcodingRequired;
/**
* constructor; determines necessity of transcoding from session charset
*/
public function __construct()
{
if(strpos($_SESSION['language_charset'], 'iso-8859') !== false)
{
$this->transcodingRequired = true;
}
else
{
$this->transcodingRequired = false;
}
}
/**
* transcodes a string for transmission to PayPal.
* @param string $string string to be converted
*/
public function transcodeOutbound($string)
{
if(!$this->transcodingRequired)
{
$output = $string;
}
else
{
$output = utf8_encode($string);
$output = html_entity_decode($output, ENT_COMPAT|ENT_HTML401, 'UTF-8');
}
return $output;
}
/**
* transcodes a string from PayPal into shop system's encoding
* @param string $string string to be converted
*/
public function transcodeInbound($string)
{
if(!$this->transcodingRequired)
{
$output = $string;
}
else
{
$output = utf8_decode($string);
}
return $output;
}
}