Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Backend/design/html/blackbox_order_info.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{/if}
{if $clientInfo.fios}
<span class="text_label">{$btr->sviat__blackbox__client_names|escape}:</span>
{', '|implode:$clientInfo.fios|escape}<br>
{foreach $clientInfo.fios as $fio}{$fio|escape}{if !$fio@last}, {/if}{/foreach}<br>
{/if}
{if $clientInfo.tracks}
{foreach $clientInfo.tracks as $track}
Expand Down
2 changes: 1 addition & 1 deletion Init/module.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Okay": "4.5.3",
"version": "1.1.1",
"version": "1.1.2",
"vendor": {
"email": "devsviat@proton.me",
"site": "https://github.com/devSviat"
Expand Down
29 changes: 29 additions & 0 deletions tests/TemplateModifiersTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace Modules\Sviat\BlackBox;

use PHPUnit\Framework\TestCase;

/**
* Шаблони модуля мусять рендеритись без повідомлень і на Smarty 5 (форк), і
* на Smarty 4 (сток). Модифікатор implode у Smarty 5 завжди дає deprecation, а
* join зі звичним порядком «масив, роздільник» у Smarty 4 — це PHP-функція
* join(), яка на PHP 8 з таким порядком падає. Списки виводяться через foreach.
*/
class TemplateModifiersTest extends TestCase
{
public function testNoImplodeOrJoinModifierInTemplates(): void
{
$templates = glob(dirname(__DIR__, 4) . '/Okay/Modules/Sviat/BlackBox/Backend/design/html/*.tpl');
$this->assertNotEmpty($templates, 'шаблони не знайшлися — зламався сам пошук');

$found = [];
foreach ($templates as $template) {
if (preg_match_all('/\|\s*(implode|join)\b/', file_get_contents($template), $m)) {
$found[] = basename($template) . ': ' . implode(', ', $m[0]);
}
}

$this->assertSame([], $found);
}
}
Loading