N°5809 Update Symfony artifacts from 6.4.0 to 6.4.2

symfony/console
symfony/dotenv
symfony/framework-bundle
symfony/http-foundation
symfony/http-kernel
symfony/var-dumper
symfony/web-profiler-bundle
This commit is contained in:
Pierre Goiffon
2024-01-26 09:55:51 +01:00
parent ddce3058be
commit dfb5a4875a
110 changed files with 1115 additions and 929 deletions

View File

@@ -13,6 +13,7 @@
constructor() {
this.#createTabs();
this.#createToggles();
this.#createCopyToClipboard();
this.#convertDateTimesToUserTimezone();
}
@@ -161,18 +162,39 @@
});
});
/* Prevents from disallowing clicks on "copy to clipboard" elements inside toggles */
const copyToClipboardElements = toggle.querySelectorAll('span[data-clipboard-text]');
copyToClipboardElements.forEach((copyToClipboardElement) => {
copyToClipboardElement.addEventListener('click', (e) => {
e.stopPropagation();
});
});
toggle.setAttribute('data-processed', 'true');
});
}
#createCopyToClipboard() {
if (!navigator.clipboard) {
return;
}
const copyToClipboardElements = document.querySelectorAll('[data-clipboard-text]');
copyToClipboardElements.forEach((copyToClipboardElement) => {
copyToClipboardElement.classList.remove('hidden');
copyToClipboardElement.addEventListener('click', (e) => {
/* Prevents from disallowing clicks on "copy to clipboard" elements inside toggles */
e.stopPropagation();
navigator.clipboard.writeText(copyToClipboardElement.getAttribute('data-clipboard-text'));
let oldContent = copyToClipboardElement.textContent;
copyToClipboardElement.textContent = `✅ Copied!`;
copyToClipboardElement.disabled = true;
setTimeout(() => {
copyToClipboardElement.textContent = oldContent;
copyToClipboardElement.disabled = false;
}, 7000);
});
});
}
#convertDateTimesToUserTimezone() {
const userTimezoneName = Intl.DateTimeFormat().resolvedOptions().timeZone;

View File

@@ -47,6 +47,8 @@
}
.sf-minitoolbar {
--sf-toolbar-gray-800: #262626;
background-color: var(--sf-toolbar-gray-800);
border-top-left-radius: 4px;
bottom: 0;
@@ -66,6 +68,8 @@
}
.sf-minitoolbar svg,
.sf-minitoolbar img {
--sf-toolbar-gray-200: #e5e5e5;
color: var(--sf-toolbar-gray-200);
max-height: 24px;
max-width: 24px;

View File

@@ -50,33 +50,6 @@
};
}
if (navigator.clipboard) {
document.addEventListener('readystatechange', () => {
if (document.readyState !== 'complete') {
return;
}
document.querySelectorAll('[data-clipboard-text]').forEach(function (element) {
removeClass(element, 'hidden');
element.addEventListener('click', function () {
navigator.clipboard.writeText(element.getAttribute('data-clipboard-text'));
if (element.classList.contains("label")) {
let oldContent = element.textContent;
element.textContent = "✅ Copied!";
element.classList.add("status-success");
setTimeout(() => {
element.textContent = oldContent;
element.classList.remove("status-success");
}, 7000);
}
});
});
});
}
var request = function(url, onSuccess, onError, payload, options, tries) {
var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');
options = options || {};
@@ -577,7 +550,9 @@
/* Evaluate in global scope scripts embedded inside the toolbar */
var i, scripts = [].slice.call(el.querySelectorAll('script'));
for (i = 0; i < scripts.length; ++i) {
eval.call({}, scripts[i].firstChild.nodeValue);
if (scripts[i].firstChild) {
eval.call({}, scripts[i].firstChild.nodeValue);
}
}
el.style.display = -1 !== xhr.responseText.indexOf('sf-toolbarreset') ? 'block' : 'none';
@@ -648,7 +623,7 @@
sfwdt.innerHTML = '\
<div class="sf-toolbarreset notranslate">\
<div class="sf-toolbar-icon"><svg width="26" height="28" xmlns="http://www.w3.org/2000/svg" version="1.1" x="0px" y="0px" viewBox="0 0 26 28" enable-background="new 0 0 26 28" xml:space="preserve"><path fill="#FFFFFF" d="M13 0C5.8 0 0 5.8 0 13c0 7.2 5.8 13 13 13c7.2 0 13-5.8 13-13C26 5.8 20.2 0 13 0z M20 7.5 c-0.6 0-1-0.3-1-0.9c0-0.2 0-0.4 0.2-0.6c0.1-0.3 0.2-0.3 0.2-0.4c0-0.3-0.5-0.4-0.7-0.4c-2 0.1-2.5 2.7-2.9 4.8l-0.2 1.1 c1.1 0.2 1.9 0 2.4-0.3c0.6-0.4-0.2-0.8-0.1-1.3C18 9.2 18.4 9 18.7 8.9c0.5 0 0.8 0.5 0.8 1c0 0.8-1.1 2-3.3 1.9 c-0.3 0-0.5 0-0.7-0.1L15 14.1c-0.4 1.7-0.9 4.1-2.6 6.2c-1.5 1.8-3.1 2.1-3.8 2.1c-1.3 0-2.1-0.6-2.2-1.6c0-0.9 0.8-1.4 1.3-1.4 c0.7 0 1.2 0.5 1.2 1.1c0 0.5-0.2 0.6-0.4 0.7c-0.1 0.1-0.3 0.2-0.3 0.4c0 0.1 0.1 0.3 0.4 0.3c0.5 0 0.9-0.3 1.2-0.5 c1.3-1 1.7-2.9 2.4-6.2l0.1-0.8c0.2-1.1 0.5-2.3 0.8-3.5c-0.9-0.7-1.4-1.5-2.6-1.8c-0.8-0.2-1.3 0-1.7 0.4C8.4 10 8.6 10.7 9 11.1 l0.7 0.7c0.8 0.9 1.3 1.7 1.1 2.7c-0.3 1.6-2.1 2.8-4.3 2.1c-1.9-0.6-2.2-1.9-2-2.7c0.2-0.6 0.7-0.8 1.2-0.6 c0.5 0.2 0.7 0.8 0.6 1.3c0 0.1 0 0.1-0.1 0.3C6 15 5.9 15.2 5.9 15.3c-0.1 0.4 0.4 0.7 0.8 0.8c0.8 0.3 1.7-0.2 1.9-0.9 c0.2-0.6-0.2-1.1-0.4-1.2l-0.8-0.9c-0.4-0.4-1.2-1.5-0.8-2.8c0.2-0.5 0.5-1 0.9-1.4c1-0.7 2-0.8 3-0.6c1.3 0.4 1.9 1.2 2.8 1.9 c0.5-1.3 1.1-2.6 2-3.8c0.9-1 2-1.7 3.3-1.8C20 4.8 21 5.4 21 6.3C21 6.7 20.8 7.5 20 7.5z"/></svg></div>\
An error occurred while loading the web debug toolbar. <a href="{{ url("_profiler_home")|escape('js') }}' + newToken + '>Open the web profiler.</a>\
An error occurred while loading the web debug toolbar. <a href="{{ url("_profiler_home")|escape('js') }}' + newToken + '">Open the web profiler.</a>\
</div>\
';
sfwdt.setAttribute('class', 'sf-toolbar sf-error-toolbar');

View File

@@ -39,10 +39,10 @@
<div class="block-exception">
<h1>Redirection Intercepted</h1>
{% set absolute_url = host in location ? location : host ~ location %}
{% set absolute_url = absolute_url(location) %}
<p>This request redirects to <strong>{{ absolute_url }}</strong></p>
<p><a class="btn" href="{{ location }}">Follow redirect</a></p>
<p><a class="btn" href="{{ absolute_url }}">Follow redirect</a></p>
<p class="sf-redirection-help">
The redirect was intercepted by the Symfony Web Debug toolbar to help debugging.

View File

@@ -14,6 +14,7 @@ namespace Symfony\Bundle\WebProfilerBundle\Twig;
use Symfony\Component\VarDumper\Cloner\Data;
use Symfony\Component\VarDumper\Dumper\HtmlDumper;
use Twig\Environment;
use Twig\Extension\EscaperExtension;
use Twig\Extension\ProfilerExtension;
use Twig\Profiler\Profile;
use Twig\TwigFunction;
@@ -78,12 +79,12 @@ class WebProfilerExtension extends ProfilerExtension
public function dumpLog(Environment $env, string $message, Data $context = null): string
{
$message = twig_escape_filter($env, $message);
$message = self::escape($env, $message);
$message = preg_replace('/&quot;(.*?)&quot;/', '&quot;<b>$1</b>&quot;', $message);
$replacements = [];
foreach ($context ?? [] as $k => $v) {
$k = '{'.twig_escape_filter($env, $k).'}';
$k = '{'.self::escape($env, $k).'}';
if (str_contains($message, $k)) {
$replacements[$k] = $v;
}
@@ -104,4 +105,14 @@ class WebProfilerExtension extends ProfilerExtension
{
return 'profiler';
}
private static function escape(Environment $env, string $s): string
{
if (method_exists(EscaperExtension::class, 'escape')) {
return EscaperExtension::escape($env, $s);
}
// to be removed when support for Twig 3 is dropped
return twig_escape_filter($env, $s);
}
}