fix: dziala aktualizacja systemu i Wyczysc cache na /admin/update/main_view/ (v0.353)
Zdalny changelog z shoppro.project-dc.pl/updates/changelog.php zwracal niezbalansowany HTML (niezamkniety <script>/<style>/<textarea>/<!--), ktory "polykal" reszte dokumentu - inline-script z handlerami #confirm/#confirmUpdateAll i footer-script z main-layout.php (#clear-cache-btn) nigdy nie parsowaly sie jako JS. Klienci nie mogli aktualizowac shopPRO. Fix w admin/templates/update/main-view.php: 1. Blok <script> z handlerami przeniesiony PRZED sekcje Changelog - handlery podpinaja sie niezaleznie od zdalnego HTML. 2. Sanityzacja zdalnego changeloga: preg_replace usuwa komentarze HTML, strip_tags z whitelista (<p><br><b><strong><i><em><u><ul><ol><li> <h1>-<h6><span><div><a><pre><code><hr>) wycina tagi strukturalne i wykonywalne (<script>, <style>, <iframe>, <textarea>). Skutek uboczny: footer-script z main-layout.php (Wyczysc cache + globalne wyszukiwanie + sprawdzanie aktualizacji) dziala teraz na podstronie update. Po wgraniu na instancje: hard-reload (Ctrl+F5) + restart PHP-FPM / wyczyszczenie OPcache. Suita PHPUnit: 846 testow / 2348 assertions OK. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -52,15 +52,6 @@
|
||||
</div>
|
||||
<? endif; ?>
|
||||
|
||||
<div class="panel">
|
||||
<div class="panel-heading">
|
||||
<span class="panel-title">Changelog</span>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?= @file_get_contents( 'https://shoppro.project-dc.pl/updates/changelog.php?ver=' . $this->ver ); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
var version_current = <?= $this->ver; ?>;
|
||||
@@ -138,3 +129,17 @@ $(function() {
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="panel">
|
||||
<div class="panel-heading">
|
||||
<span class="panel-title">Changelog</span>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?php
|
||||
$changelog = (string) @file_get_contents( 'https://shoppro.project-dc.pl/updates/changelog.php?ver=' . $this->ver );
|
||||
$changelog = preg_replace( '/<!--.*?-->/s', '', $changelog );
|
||||
$changelog = strip_tags( $changelog, '<p><br><b><strong><i><em><u><ul><ol><li><h1><h2><h3><h4><h5><h6><span><div><a><pre><code><hr>' );
|
||||
echo $changelog;
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user