mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Temporarily disable extra functionality in the VersionYamlProcessor
This commit is contained in:
parent
7edb3e02c5
commit
9b1154ba31
@ -1,5 +1,6 @@
|
||||
<?php namespace System\Classes;
|
||||
|
||||
use Str;
|
||||
use Winter\Storm\Parse\Processor\YamlProcessor;
|
||||
|
||||
/**
|
||||
@ -21,6 +22,18 @@ class VersionYamlProcessor extends YamlProcessor
|
||||
$lines = preg_split('/[\n\r]+/', $text, -1, PREG_SPLIT_NO_EMPTY);
|
||||
|
||||
foreach ($lines as $num => &$line) {
|
||||
// Ensure that !!! lines are quoted
|
||||
// @TODO: This is a brittle workaround, identify the possible cases where this can be a problem
|
||||
// i.e. quotes inside the message, message part of multi-message update, etc; and resolve them
|
||||
if (Str::contains($line, ': !!!')) {
|
||||
$line = Str::replace(': !!!', ': "!!!', $line);
|
||||
$line .= '"';
|
||||
}
|
||||
|
||||
continue;
|
||||
|
||||
|
||||
|
||||
// Surround array keys with quotes if not already
|
||||
$line = preg_replace_callback('/^\s*([\'"]{0}[^\'"\n\r:]+[\'"]{0})\s*:/m', function ($matches) {
|
||||
return '"' . trim($matches[1]) . '":';
|
||||
|
Loading…
x
Reference in New Issue
Block a user