Skip to content

Instantly share code, notes, and snippets.

View bka's full-sized avatar

Bernhard bka

View GitHub Profile
<?php
// vendor/zendframework/zend-mail/src/Transport/Sendmail.php
$writer = new \Zend\Log\Writer\Stream(BP . '/var/log/mail.log');
$logger = new \Zend\Log\Logger();
$logger->addWriter($writer);
$logger->info(\print_r(['to' => $to, 'subject' => $subject, 'headers' => $headers, 'parameters' => $parameters], true));
@bka
bka / magento-twig-theme-setup.md
Last active June 5, 2020 11:00
Magento 2 Installation Guide with sample data for Twig Theme using magedev

Step 1: Install Magento 2 with Sample Data

This guide is based on magedev. Skip to Step 2 for other setups.

git clone https://github.com/magento/magento2.git -b 2.3.4 Source

cat >magedev.json <<'EOL'
{
  "magento_version": "2",

"project_name": "twigdemo",

@bka
bka / magedev.json
Created June 23, 2021 08:06
magedev.json magento 2.4.x
{
"magento_version": "2",
"project_name": "magento2-demo",
"php_version": "7.4",
"image_version": "1.1",
"domain": "magento.local",
"mysql_version": "5.7",
"es_version": "7.10.1",
"dump_file": "var/dump.sql",
"source_folder": "Source/",
<?php
/* Test script for reproducing https://github.com/magento/magento2/issues/35616
*
* 1. Mode of catalog_product_price indexer must be update by schedule.
*
* 2. Place this script into $MAGE_ROOT/scripts/index-buster.php
*
* 3. Execute it `php scripts/index-buster.php`. Do not terminate it. Wait for output to be ready.
*
{
"extra": {
"magento-force": "override",
"enable-patching": true,
"patches": {
"magento/module-customer": {
"CVE-2023-38218": "patches/CVE-2023-38218.patch"
}
}
},
diff --git Plugin/Webapi/Controller/Rest/ValidateCustomerData.php Plugin/Webapi/Controller/Rest/ValidateCustomerData.php
index ad2d8ed..63551ff 100644
--- Plugin/Webapi/Controller/Rest/ValidateCustomerData.php
+++ Plugin/Webapi/Controller/Rest/ValidateCustomerData.php
@@ -28,8 +28,8 @@ class ValidateCustomerData
*/
public function beforeOverride(ParamsOverrider $subject, array $inputData, array $parameters): array
{
- if (isset($inputData[self:: CUSTOMER_KEY])) {
- $inputData[self:: CUSTOMER_KEY] = $this->validateInputData($inputData[self:: CUSTOMER_KEY]);
location ~ /rest/([^/]*/)?V1/customers/me {
deny all;
}