Skip to content

Instantly share code, notes, and snippets.

@Marko-M
Last active August 29, 2015 14:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Marko-M/d8da4b0a53a5c65654a3 to your computer and use it in GitHub Desktop.
Save Marko-M/d8da4b0a53a5c65654a3 to your computer and use it in GitHub Desktop.
PHP 7.0 beta 3 Magento 1.x patch
diff --git a/app/code/core/Mage/Core/Model/Layout.php b/app/code/core/Mage/Core/Model/Layout.php
index f5dc619..373736d 100644
--- a/app/code/core/Mage/Core/Model/Layout.php
+++ b/app/code/core/Mage/Core/Model/Layout.php
@@ -552,7 +552,7 @@ class Mage_Core_Model_Layout extends Varien_Simplexml_Config
$out = '';
if (!empty($this->_output)) {
foreach ($this->_output as $callback) {
- $out .= $this->getBlock($callback[0])->$callback[1]();
+ $out .= $this->getBlock($callback[0])->{$callback[1]}();
}
}
diff --git a/app/code/core/Mage/Core/Model/Session/Abstract.php b/app/code/core/Mage/Core/Model/Session/Abstract.php
index 8386fb8..a287df6 100644
--- a/app/code/core/Mage/Core/Model/Session/Abstract.php
+++ b/app/code/core/Mage/Core/Model/Session/Abstract.php
@@ -564,6 +564,8 @@ class Mage_Core_Model_Session_Abstract extends Mage_Core_Model_Session_Abstract_
*/
public function renewSession()
{
+ return $this;
+
$this->getCookie()->delete($this->getSessionName());
$this->regenerateSessionId();
diff --git a/app/code/core/Mage/Core/functions.php b/app/code/core/Mage/Core/functions.php
index d9ba409..694acee 100644
--- a/app/code/core/Mage/Core/functions.php
+++ b/app/code/core/Mage/Core/functions.php
@@ -375,3 +375,32 @@ if ( !function_exists('sys_get_temp_dir') ) {
}
}
}
+
+define('ICONV_IMPL', false);
+
+if( !function_exists('iconv_strlen')) {
+ function iconv_strlen($string, $charset = null) {
+ return strlen($string);
+ }
+}
+
+if( !function_exists('iconv_substr')) {
+ function iconv_substr($string, $offset, $length = null, $charset = null) {
+ if(is_null($length)) {
+ $length = iconv_strlen($string);
+ }
+ return substr($string, $offset, $length);
+ }
+}
+
+if( !function_exists('iconv_strpos')) {
+ function iconv_strpos($haystack, $needle, $offset = 0, $charset = null) {
+ return strpos($haystack, $needle, $offset);
+ }
+}
+
+if( !function_exists('iconv_strrpos')) {
+ function iconv_strrpos($haystack, $needle, $offset = 0, $charset = null) {
+ return strrpos($haystack, $needle, $offset);
+ }
+}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment