From d5268a98ac4197f907e05076eb47d40ac134d958 Mon Sep 17 00:00:00 2001 From: Lars Gebhardt-Kusche Date: Sat, 6 Dec 2025 03:00:48 +0100 Subject: [PATCH] asd --- public/editor/bridge-core.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/public/editor/bridge-core.js b/public/editor/bridge-core.js index 61550f5..544eadf 100644 --- a/public/editor/bridge-core.js +++ b/public/editor/bridge-core.js @@ -47,7 +47,6 @@ B.BASE_PATH_CONFIG = B.BASE_PATH_BRIDGE; const apiFallback = '/api.php'; B.API_BASE = B.API_BASE || apiFallback; - B.STORAGE_URL_BASE = B.STORAGE_URL_BASE || B.API_BASE; B.API_KERNEL_URL = B.API_KERNEL_URL || B.API_BASE;          B.GrapesJSPlugins = [];  @@ -260,9 +259,8 @@         }                  // Speicherkonfiguration extrahieren, um die URL in onLoad zu verwenden. -        // 🎯 KORREKTUR für mehr Flexibilität: Verwende B.STORAGE_URL_BASE, falls gesetzt, anstatt window.location.href. -        // Verwenden Sie B.API_BASE (Standard /api/editor) als Fallback für die Storage-URL -        const storageBase = B.STORAGE_URL_BASE || B.API_BASE; // B.API_BASE sollte jetzt korrekt sein +        // Verwenden Sie immer die zentrale API-Basis +        const storageBase = B.API_BASE;         // Robustes Anhängen von Query-Parametern.         // Prüft, ob 'storageBase' bereits Query-Parameter enthält ('?') @@ -270,8 +268,8 @@ const resourceName = (window.__editorMode || 'templates'); const entityId = (window.__editorId || 0); - const loadUrl = `${storageBase}${actionSeparator}action=${resourceName}.get&id=${entityId}`; - const storeUrl = `${storageBase}${actionSeparator}action=${resourceName}.update&id=${entityId}`; + const loadUrl = `${storageBase}${actionSeparator}action=${encodeURIComponent(resourceName)}.get&id=${encodeURIComponent(entityId)}`; + const storeUrl = `${storageBase}${actionSeparator}action=${encodeURIComponent(resourceName)}.update&id=${encodeURIComponent(entityId)}`;         const storageConf = {             type: 'remote', @@ -292,8 +290,8 @@ ...options }; fetchOptions.headers = { - 'Content-Type': 'application/json', ...(options?.headers || {}), + 'Content-Type': 'application/json', }; if (!fetchOptions.credentials || fetchOptions.credentials === 'omit') { fetchOptions.credentials = 'include';