Skip to content

Instantly share code, notes, and snippets.

@balloz
balloz / fix-downloader.diff
Created October 17, 2016 08:05
Fix Magento Connect SSL version
diff --git a/downloader/lib/Mage/HTTP/Client/Curl.php b/downloader/lib/Mage/HTTP/Client/Curl.php
index a777beb..1a39b19 100644
--- a/downloader/lib/Mage/HTTP/Client/Curl.php
+++ b/downloader/lib/Mage/HTTP/Client/Curl.php
@@ -380,7 +380,7 @@ implements Mage_HTTP_IClient
* @link http://php.net/manual/ru/function.curl-setopt.php
*/
- $this->curlOption(CURLOPT_SSLVERSION, 1);
+ $this->curlOption(CURLOPT_SSLVERSION, 5);
@balloz
balloz / unbreak-api.diff
Created October 14, 2016 15:18
Unbreak the API in Magento 1.9.3. Not convinced this is correct, as nested properties in objects and arrays do not get the XML escaping magic applied to them. At least this is no less broken than it was before 1.9.3!
diff --git a/app/code/core/Mage/Api/Model/Server/Handler/Abstract.php b/app/code/core/Mage/Api/Model/Server/Handler/Abstract.php
index bfc6763..2566340 100644
--- a/app/code/core/Mage/Api/Model/Server/Handler/Abstract.php
+++ b/app/code/core/Mage/Api/Model/Server/Handler/Abstract.php
@@ -556,12 +556,16 @@ abstract class Mage_Api_Model_Server_Handler_Abstract
* @param array $result
* @return mixed
*/
- public function processingMethodResult(array $result)
+ public function processingMethodResult($result)
@balloz
balloz / fix-broken-unserialize.diff
Last active August 19, 2019 14:01
Fix broken unserialize in Magento SUPEE-8788 patch
diff --git a/lib/Unserialize/Parser.php b/lib/Unserialize/Parser.php
index 20a6a3c..88c6555 100644
--- a/lib/Unserialize/Parser.php
+++ b/lib/Unserialize/Parser.php
@@ -34,6 +34,7 @@ class Unserialize_Parser
const TYPE_DOUBLE = 'd';
const TYPE_ARRAY = 'a';
const TYPE_BOOL = 'b';
+ const TYPE_NULL = 'N';
@balloz
balloz / 0001-Fixed-1.9.3-search.patch
Created October 13, 2016 12:32
Magento 1.9.3 fixed search
From d48811b478c59299eacce45c49f2d3bb25291151 Mon Sep 17 00:00:00 2001
From: Bas Mostert <[email protected]>
Date: Thu, 13 Oct 2016 13:30:37 +0100
Subject: [PATCH] Fixed 1.9.3 search
---
.../Mage/CatalogSearch/Model/Resource/Fulltext.php | 56 +++++++++++-----------
.../Model/Resource/Fulltext/Collection.php | 3 +-
2 files changed, 30 insertions(+), 29 deletions(-)

Keybase proof

I hereby claim:

  • I am balloz on github.
  • I am balloz (https://keybase.io/balloz) on keybase.
  • I have a public key whose fingerprint is 5B87 1F1D 3754 EDCE 2F81 1CAC 1537 6393 8D50 AC8D

To claim this, I am signing this object:

@balloz
balloz / PATCH_SUPEE-3941_EE_1.14.0.1_v1.sh
Created August 20, 2014 08:13
Magento patch SUPEE-3941
#!/bin/bash
# Patch apllying tool template
# v0.1.2
# (c) Copyright 2013. Magento Inc.
#
# DO NOT CHANGE ANY LINE IN THIS FILE.
# 1. Check required system tools
_check_installed_tools() {
local missed=""
@balloz
balloz / gist:0832c3649f555c9c602f
Created August 20, 2014 08:07
Magento SUPEE-3762 patch
#!/bin/bash
# Patch apllying tool template
# v0.1.2
# (c) Copyright 2013. Magento Inc.
#
# DO NOT CHANGE ANY LINE IN THIS FILE.
# 1. Check required system tools
_check_installed_tools() {
local missed=""
{
"vars": {
"@gray-darker": "lighten(#000, 13.5%)",
"@gray-dark": "lighten(#000, 20%)",
"@gray": "lighten(#000, 33.5%)",
"@gray-light": "lighten(#000, 60%)",
"@gray-lighter": "lighten(#000, 93.5%)",
"@brand-primary": "#428bca",
"@brand-success": "#5cb85c",
"@brand-info": "#5bc0de",

Keybase proof

I hereby claim:

  • I am balloz on github.
  • I am balloz (https://keybase.io/balloz) on keybase.
  • I have a public key whose fingerprint is 5B87 1F1D 3754 EDCE 2F81 1CAC 1537 6393 8D50 AC8D

To claim this, I am signing this object:

protected function _validateUkPostcode($postcode) {
// Permitted letters depend upon their position in the postcode.
$alpha1 = "[abcdefghijklmnoprstuwyz]"; // Character 1
$alpha2 = "[abcdefghklmnopqrstuvwxy]"; // Character 2
$alpha3 = "[abcdefghjkpmnrstuvwxy]"; // Character 3
$alpha4 = "[abehmnprvwxy]"; // Character 4
$alpha5 = "[abdefghjlnpqrstuwxyz]"; // Character 5
// Expression for postcodes: AN NAA, ANN NAA, AAN NAA, and AANN NAA with a space
$pcexp[0] = '^('.$alpha1.'{1}'.$alpha2.'{0,1}[0-9]{1,2})([[:space:]]{0,})([0-9]{1}'.$alpha5.'{2})$';