Skip to content

Instantly share code, notes, and snippets.

@barryvdh
barryvdh / PRODSECBUG-2198-2.2-CE-2019-03-25-08-43-16-framework.patch
Last active April 1, 2019 08:17 — forked from peterjaap/PRODSECBUG-2198-2.2-CE-2019-03-25-08-43-16-framework.patch
Magento 2.2 patch for PRODSECBUG-2198 in composer.patches.json format for magento/framework, using `cweagans/composer-patches`
diff --git a/DB/Adapter/Pdo/Mysql.php b/DB/Adapter/Pdo/Mysql.php
index 1449d6d..38085a3 100644
--- a/DB/Adapter/Pdo/Mysql.php
+++ b/DB/Adapter/Pdo/Mysql.php
@@ -2904,7 +2904,7 @@ class Mysql extends \Zend_Db_Adapter_Pdo_Mysql implements AdapterInterface
if (isset($condition['to'])) {
$query .= empty($query) ? '' : ' AND ';
$to = $this->_prepareSqlDateCondition($condition, 'to');
- $query = $this->_prepareQuotedSqlCondition($query . $conditionKeyMap['to'], $to, $fieldName);
+ $query = $query . $this->_prepareQuotedSqlCondition($conditionKeyMap['to'], $to, $fieldName);
@barryvdh
barryvdh / deploy.php
Last active September 7, 2018 03:01 — forked from jakebathman/logslaravel.sh
Tail Laravel logs and filter out the stack traces using https://deployer.org/
desc('Tail your laravel.log file');
task('tail', function () {
$numLines = isVerbose() ? '100' : '1000';
$tail = "tail -n {$numLines} {{deploy_path}}/current/storage/logs/laravel*.log ";
if (!isVerbose()) {
// Change -P to -E, depending on OS or grep version.
$tail .= '| grep -i -P "^\[\d{4}\-\d{2}\-\d{2} \d{2}:\d{2}:\d{2}\]|Next [\w\W]+?\:" | tail -n 100 ';
}
$output = run($tail);
@barryvdh
barryvdh / bench.php
Last active February 2, 2016 08:05 — forked from nikic/bench.php
Benchmark of call_user_func_array vs switch optimization vs argument unpacking syntax
<?php error_reporting(E_ALL);
function test() {}
$nIter = 1000000;
$argNums = [0, 1, 2, 3, 4, 5, 100];
$func = 'test';
foreach ($argNums as $argNum) {
@barryvdh
barryvdh / PATCH_SUPEE-389_EE_1.12.0.2_v2.sh
Last active August 29, 2015 14:26 — forked from piotrekkaminski/PATCH_SUPEE-389_EE_1.12.0.2_v2.sh
SUPEE-389: Every time the catalog URL is rendexed, a new custom rewrite is created
#!/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=""
@barryvdh
barryvdh / .gitignore
Last active March 15, 2016 18:53 — forked from Ocramius/.gitignore
tests
composer.lock
composer.phar
vendor