<?php
use Phinx\Migration\AbstractMigration;
class ReplaceCharsInLogs extends AbstractMigration
{
/**
* Migrate Up.
*/
public function up(): void
{
$this->execute("UPDATE logs SET request = replace(`request`, '&', '&')");
$this->execute("UPDATE logs SET request = replace(`request`, '"', '\"')");
$this->execute("UPDATE logs SET request = replace(`request`, ''', \"'\")");
$this->execute("UPDATE logs SET request = replace(`request`, ''', \"'\")");
$this->execute("UPDATE logs SET request = replace(`request`, '$', '$')");
$this->execute("UPDATE logs SET request = replace(`request`, '\', '\\\')");
$this->execute("UPDATE logs SET request = replace(`request`, '|', '|')");
$this->execute("UPDATE logs SET request = replace(`request`, '^', '^')");
$this->execute("UPDATE logs SET request = replace(`request`, '`', '`')");
$this->execute("UPDATE logs SET request = replace(`request`, '%', '%')");
$this->execute("UPDATE logs SET request = replace(`request`, ':', ':')");
$this->execute("UPDATE logs SET request = replace(`request`, '@', '@')");
$this->execute("UPDATE logs SET request = replace(`request`, '<', '<')");
$this->execute("UPDATE logs SET request = replace(`request`, '>', '>')");
$this->execute("UPDATE logs SET referer = replace(`referer`, '&', '&')");
$this->execute("UPDATE logs SET referer = replace(`referer`, '"', '\"')");
$this->execute("UPDATE logs SET referer = replace(`referer`, ''', \"'\")");
$this->execute("UPDATE logs SET referer = replace(`referer`, ''', \"'\")");
$this->execute("UPDATE logs SET referer = replace(`referer`, '$', '$')");
$this->execute("UPDATE logs SET referer = replace(`referer`, '\', '\\\')");
$this->execute("UPDATE logs SET referer = replace(`referer`, '|', '|')");
$this->execute("UPDATE logs SET referer = replace(`referer`, '^', '^')");
$this->execute("UPDATE logs SET referer = replace(`referer`, '`', '`')");
$this->execute("UPDATE logs SET referer = replace(`referer`, '%', '%')");
$this->execute("UPDATE logs SET referer = replace(`referer`, ':', ':')");
$this->execute("UPDATE logs SET referer = replace(`referer`, '@', '@')");
$this->execute("UPDATE logs SET referer = replace(`referer`, '<', '<')");
$this->execute("UPDATE logs SET referer = replace(`referer`, '>', '>')");
}
/**
* Migrate Down.
*/
public function down(): void
{
$this->execute("UPDATE logs SET request = replace(`request`, '&', '&')");
$this->execute("UPDATE logs SET request = replace(`request`, '\"', '"')");
$this->execute("UPDATE logs SET request = replace(`request`, \"'\", ''')");
$this->execute("UPDATE logs SET request = replace(`request`, '<', '<')");
$this->execute("UPDATE logs SET request = replace(`request`, '>', '>')");
$this->execute("UPDATE logs SET referer = replace(`referer`, '&', '&')");
$this->execute("UPDATE logs SET referer = replace(`referer`, '\"', '"')");
$this->execute("UPDATE logs SET referer = replace(`referer`, \"'\", ''')");
$this->execute("UPDATE logs SET referer = replace(`referer`, '<', '<')");
$this->execute("UPDATE logs SET referer = replace(`referer`, '>', '>')");
}
}