From 6f5f894ed539c698578657fad91d82b0dfc62d3c Mon Sep 17 00:00:00 2001 From: Patrizio Bekerle Date: Wed, 2 Sep 2015 08:44:24 +0200 Subject: [PATCH 1/2] workaround to the get the customer order view working with email addresses that include a "+" character --- design/admin/templates/shop/orderlist.tpl | 2 +- kernel/shop/customerorderview.php | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/design/admin/templates/shop/orderlist.tpl b/design/admin/templates/shop/orderlist.tpl index 62e6f0414a0..4ffb226e64e 100644 --- a/design/admin/templates/shop/orderlist.tpl +++ b/design/admin/templates/shop/orderlist.tpl @@ -73,7 +73,7 @@ {if is_null($Orders.item.account_name)} {'( removed )'|i18n( 'design/admin/shop/orderlist' )} {else} - {$Orders.item.account_name|wash} + nodeName : ''; @@ -933,7 +933,7 @@ function &inputListXML( &$listNode, $currentSectionLevel, $listSectionLevel = nu \private \return the user input format for the given table cell */ - function &inputTdXML( &$tdNode, $currentSectionLevel, $tdSectionLevel = null ) + function inputTdXML( &$tdNode, $currentSectionLevel, $tdSectionLevel = null ) { $output = ''; $tagName = $tdNode instanceof DOMNode ? $tdNode->nodeName : ''; @@ -962,7 +962,7 @@ function &inputTdXML( &$tdNode, $currentSectionLevel, $tdSectionLevel = null ) /*! \return the input xml of the given paragraph */ - function &inputParagraphXML( &$paragraph, + function inputParagraphXML( &$paragraph, $currentSectionLevel, $tdSectionLevel = null, $noRender = false ) @@ -1046,7 +1046,7 @@ function &inputParagraphXML( &$paragraph, \return the input xml for the given tag \as in the xhtml used inside the editor */ - function &inputTagXML( &$tag, $currentSectionLevel, $tdSectionLevel = null ) + function inputTagXML( &$tag, $currentSectionLevel, $tdSectionLevel = null ) { $output = ''; $tagName = $tag instanceof DOMNode ? $tag->nodeName : ''; diff --git a/extension/ezoe/modules/ezoe/classes/GoogleSpell.php b/extension/ezoe/modules/ezoe/classes/GoogleSpell.php index 7efd171b2fb..0dcefb7d413 100644 --- a/extension/ezoe/modules/ezoe/classes/GoogleSpell.php +++ b/extension/ezoe/modules/ezoe/classes/GoogleSpell.php @@ -105,8 +105,8 @@ function &_getMatches($lang, $str) { } function _unhtmlentities($string) { - $string = preg_replace('~&#x([0-9a-f]+);~ei', 'chr(hexdec("\\1"))', $string); - $string = preg_replace('~&#([0-9]+);~e', 'chr(\\1)', $string); + $string = preg_replace_callback('~&#x([0-9a-f]+);~i', function($m) {return chr(hexdec($m[1]));}, $string); + $string = preg_replace_callback('~&#([0-9]+);~', function($m) {return chr($m[1]);}, $string); $trans_tbl = get_html_translation_table(HTML_ENTITIES); $trans_tbl = array_flip($trans_tbl); diff --git a/extension/ezoe/modules/ezoe/classes/SpellChecker.php b/extension/ezoe/modules/ezoe/classes/SpellChecker.php index bc344cedd62..f66e68a93ae 100644 --- a/extension/ezoe/modules/ezoe/classes/SpellChecker.php +++ b/extension/ezoe/modules/ezoe/classes/SpellChecker.php @@ -12,7 +12,7 @@ class SpellChecker { * * @param $config Configuration name/value array. */ - function SpellChecker(&$config) { + function __construct(&$config) { $this->_config = $config; } diff --git a/extension/ezoe/modules/ezoe/classes/utils/mcejson.php b/extension/ezoe/modules/ezoe/classes/utils/mcejson.php index f608c54d96d..0fdddf93eb5 100644 --- a/extension/ezoe/modules/ezoe/classes/utils/mcejson.php +++ b/extension/ezoe/modules/ezoe/classes/utils/mcejson.php @@ -36,7 +36,7 @@ class Moxiecode_JSONReader private $_lastLocations; private $_needProp; - function Moxiecode_JSONReader($data) { + function __construct($data) { $this->_data = $data; $this->_len = strlen($data); $this->_pos = -1; @@ -367,7 +367,7 @@ function peek() { * @package MCManager.utils */ class Moxiecode_JSON { - function Moxiecode_JSON() { + function __construct() { } function decode($input) { diff --git a/extension/ezoe/modules/ezoe/spellcheck_rpc.php b/extension/ezoe/modules/ezoe/spellcheck_rpc.php index d0684f244da..9b41ac26356 100644 --- a/extension/ezoe/modules/ezoe/spellcheck_rpc.php +++ b/extension/ezoe/modules/ezoe/spellcheck_rpc.php @@ -78,8 +78,8 @@ function getRequestParam($name, $default_value = false, $sanitize = false) // Try globals array if (!$raw && isset($_GLOBALS["HTTP_RAW_POST_DATA"])) $raw = $_GLOBALS["HTTP_RAW_POST_DATA"]; -else if (!$raw && isset($HTTP_RAW_POST_DATA)) - $raw = $HTTP_RAW_POST_DATA; +else if (!$raw) + $raw = file_get_contents("php://input");; // Try stream if (!$raw) diff --git a/kernel/classes/datatypes/ezxmltext/ezxmloutputhandler.php b/kernel/classes/datatypes/ezxmltext/ezxmloutputhandler.php index 680cd474ca9..ecaaacbf768 100644 --- a/kernel/classes/datatypes/ezxmltext/ezxmloutputhandler.php +++ b/kernel/classes/datatypes/ezxmltext/ezxmloutputhandler.php @@ -136,7 +136,7 @@ function isValid() \pure \return the suffix for the attribute template, if false it is ignored. */ - function &viewTemplateSuffix( &$contentobjectAttribute ) + function viewTemplateSuffix( &$contentobjectAttribute ) { $suffix = false; return $suffix; diff --git a/kernel/url/view.php b/kernel/url/view.php index 2ca2e72e274..21622d33bce 100644 --- a/kernel/url/view.php +++ b/kernel/url/view.php @@ -50,7 +50,7 @@ $preFix = $protocol . "://" . $domain; $preFix .= eZSys::wwwDir(); - $link = preg_replace("/^\//e", "", $link ); + $link = preg_replace("/^\//", "", $link ); $link = $preFix . "/" . $link; } diff --git a/lib/ezdb/classes/ezmysqlidb.php b/lib/ezdb/classes/ezmysqlidb.php index 49e3201449f..cf43e5c018c 100644 --- a/lib/ezdb/classes/ezmysqlidb.php +++ b/lib/ezdb/classes/ezmysqlidb.php @@ -844,7 +844,7 @@ function escapeString( $str ) else { eZDebug::writeDebug( 'escapeString called before connection is made', __METHOD__ ); - return mysql_escape_string( $str ); + return mysqli_real_escape_string( $str ); } } diff --git a/lib/ezdbschema/classes/ezmysqlschema.php b/lib/ezdbschema/classes/ezmysqlschema.php index b0c412e5472..415b29415d3 100644 --- a/lib/ezdbschema/classes/ezmysqlschema.php +++ b/lib/ezdbschema/classes/ezmysqlschema.php @@ -655,7 +655,7 @@ function escapeSQLString( $value ) return $this->DBInstance->escapeString( $value ); } - return mysql_escape_string( $value ); + return mysqli_real_escape_string( $value ); } function schemaType() diff --git a/lib/ezfile/classes/ezgzipzlibcompressionhandler.php b/lib/ezfile/classes/ezgzipzlibcompressionhandler.php index b425b90f557..f696609d857 100644 --- a/lib/ezfile/classes/ezgzipzlibcompressionhandler.php +++ b/lib/ezfile/classes/ezgzipzlibcompressionhandler.php @@ -51,11 +51,15 @@ function compressionLevel() static function isAvailable() { $extensionName = 'zlib'; + + // dl() is removed in PHP 7.0, see https://secure.php.net/manual/en/function.dl.php + /* if ( !extension_loaded( $extensionName ) ) { $dlExtension = ( eZSys::osType() == 'win32' ) ? '.dll' : '.so'; @dl( $extensionName . $dlExtension ); } + */ return extension_loaded( $extensionName ); } diff --git a/lib/ezpdf/classes/class.ezpdftable.php b/lib/ezpdf/classes/class.ezpdftable.php index 446e342cb12..5bc5f303ab7 100644 --- a/lib/ezpdf/classes/class.ezpdftable.php +++ b/lib/ezpdf/classes/class.ezpdftable.php @@ -33,7 +33,7 @@ class eZPDFTable extends Cezpdf * @param string $paper * @param string $orientation */ - function eZPDFTable($paper='a4',$orientation='portrait') + function __construct($paper='a4',$orientation='portrait') { parent::__construct( $paper, $orientation ); $this->TOC = array(); @@ -1516,7 +1516,7 @@ function callFont( $params ) return ''; } - function &fixWhitespace( &$text ) + function fixWhitespace( &$text ) { $text = str_replace( array( self::SPACE, self::TAB, diff --git a/lib/ezpdf/classes/class.pdf.php b/lib/ezpdf/classes/class.pdf.php index f812e2b0e78..aa088774034 100644 --- a/lib/ezpdf/classes/class.pdf.php +++ b/lib/ezpdf/classes/class.pdf.php @@ -2014,10 +2014,10 @@ function selectFont( $fontName, $encoding = '', $set = 1 ) // note that pdf supports only binary format type 1 font files, though there is a // simple utility to convert them from pfa to pfb. $fp = fopen( $fbfile, 'rb' ); - $tmp = get_magic_quotes_runtime(); - set_magic_quotes_runtime( 0 ); +// $tmp = get_magic_quotes_runtime(); +// set_magic_quotes_runtime( 0 ); $data = fread( $fp, filesize( $fbfile ) ); - set_magic_quotes_runtime( $tmp ); +// set_magic_quotes_runtime( $tmp ); fclose( $fp ); // create the font descriptor @@ -3564,8 +3564,8 @@ function addPngFromFile( $file, $x, $y, $w = 0, $h = 0 ) { // read in a png file, interpret it, then add to the system $error = 0; - $tmp = get_magic_quotes_runtime(); - set_magic_quotes_runtime(0); +// $tmp = get_magic_quotes_runtime(); +// set_magic_quotes_runtime(0); $fp = @fopen( $file, 'rb' ); if ( $fp ) { @@ -3581,7 +3581,7 @@ function addPngFromFile( $file, $x, $y, $w = 0, $h = 0 ) $error = 1; $errormsg = 'trouble opening file: '.$file; } - set_magic_quotes_runtime( $tmp ); +// set_magic_quotes_runtime( $tmp ); if ( !$error ) { @@ -3832,10 +3832,10 @@ function addJpegFromFile( $img, $x, $y, $w = 0, $h = 0 ) $fp = fopen( $img, 'rb' ); - $tmp = get_magic_quotes_runtime(); - set_magic_quotes_runtime( 0 ); +// $tmp = get_magic_quotes_runtime(); +// set_magic_quotes_runtime( 0 ); $data = fread( $fp, filesize( $img ) ); - set_magic_quotes_runtime( $tmp ); +// set_magic_quotes_runtime( $tmp ); fclose( $fp ); @@ -3888,8 +3888,8 @@ function addImage( &$img, $x, $y, $w = 0, $h = 0, $quality = 75 ) imagejpeg( $img, $tmpName, $quality ); $fp = fopen( $tmpName, 'rb' ); - $tmp = get_magic_quotes_runtime(); - set_magic_quotes_runtime( 0 ); +// $tmp = get_magic_quotes_runtime(); +// set_magic_quotes_runtime( 0 ); $fp = @fopen( $tmpName, 'rb' ); if ( $fp ) { @@ -3906,7 +3906,7 @@ function addImage( &$img, $x, $y, $w = 0, $h = 0, $quality = 75 ) $errormsg = 'trouble opening file'; } // $data = fread($fp,filesize($tmpName)); - set_magic_quotes_runtime( $tmp ); +// set_magic_quotes_runtime( $tmp ); // fclose( $fp ); unlink( $tmpName ); $this->addJpegImage_common( $data, $x, $y, $w, $h, $imageWidth, $imageHeight ); diff --git a/lib/ezsoap/classes/ezsoapserver.php b/lib/ezsoap/classes/ezsoapserver.php index f31c98b510c..10964b52d52 100644 --- a/lib/ezsoap/classes/ezsoapserver.php +++ b/lib/ezsoap/classes/ezsoapserver.php @@ -50,8 +50,7 @@ class eZSOAPServer { public function __construct() { - global $HTTP_RAW_POST_DATA; - $this->RawPostData = $HTTP_RAW_POST_DATA; + $this->RawPostData = file_get_contents( "php://input" ); } diff --git a/tests/toolkit/extras/tests-files/workflowevent_regression_fetchtemplaterepeat.php b/tests/toolkit/extras/tests-files/workflowevent_regression_fetchtemplaterepeat.php index 646dd0bd9db..5119404969d 100644 --- a/tests/toolkit/extras/tests-files/workflowevent_regression_fetchtemplaterepeat.php +++ b/tests/toolkit/extras/tests-files/workflowevent_regression_fetchtemplaterepeat.php @@ -13,7 +13,7 @@ class WorkflowEventRegressionFetchTemplateRepeatType extends eZWorkflowEventType const WORKFLOW_TYPE_STRING = 'fetchtemplaterepeat'; function __construct() { - $this->eZWorkflowEventType( WorkflowEventRegressionFetchTemplateRepeatType::WORKFLOW_TYPE_STRING, "WorkflowEventRegressionFetchTemplateRepeatType test" ); + parent::__construct( WorkflowEventRegressionFetchTemplateRepeatType::WORKFLOW_TYPE_STRING, "WorkflowEventRegressionFetchTemplateRepeatType test" ); $this->setTriggerTypes( array( 'content' => array( 'publish' => array( 'before' ) ) ) ); }