<commit_before><?php
use Cake\Core\Configure;
use Cake\ORM\TableRegistry;
use Qobo\Utils\Utility\User;
use RolesCapabilities\Access\AccessFactory;

$this->Html->script(['/dist/vendor', '/dist/app'], ['block' => 'scriptBottom']);
$this->Html->css('/dist/style', ['block' => 'css']);

$tableName = $this->name . ($this->plugin ? '.' . $this->plugin : '');
$table = TableRegistry::get($tableName);

$accessFactory = new AccessFactory();
$urlBatch = ['plugin' => $this->plugin, 'controller' => $this->name, 'action' => 'batch'];
$urlExport = ['plugin' => $this->plugin, 'controller' => $this->name, 'action' => 'exportSearch'];
?>
<section class="content-header"></section>
<section class="content">
    <search
        :display-fields='<?= json_encode($this->Search->getDisplayFields($tableName)) ?>'
        filters='<?= json_encode($this->Search->getFilters($tableName)) ?>'
        id="<?= $searchId ?>"
        search-query="<?= '' !== $searchId ? '' : $searchQuery ?>"
        model="<?= $this->name ?>"
        primary-key="<?= $table->aliasField($table->getPrimaryKey()) ?>"
        user-id="<?= User::getCurrentUser()['id'] ?>"
        :with-batch-delete="<?= $accessFactory->hasAccess($urlBatch, $user) ? 'true' : 'false' ?>"
        :with-batch-edit="<?= $accessFactory->hasAccess($urlBatch, $user) ? 'true' : 'false' ?>"
        :with-export="<?= $accessFactory->hasAccess($urlExport, $user) ? 'true' : 'false' ?>"
    ></search>
</section><commit_msg>Escape json_encoded string (task #15031)<commit_after><?php
use Cake\Core\Configure;
use Cake\ORM\TableRegistry;
use Qobo\Utils\Utility\User;
use RolesCapabilities\Access\AccessFactory;

$this->Html->script(['/dist/vendor', '/dist/app'], ['block' => 'scriptBottom']);
$this->Html->css('/dist/style', ['block' => 'css']);

$tableName = $this->name . ($this->plugin ? '.' . $this->plugin : '');
$table = TableRegistry::get($tableName);

$accessFactory = new AccessFactory();
$urlBatch = ['plugin' => $this->plugin, 'controller' => $this->name, 'action' => 'batch'];
$urlExport = ['plugin' => $this->plugin, 'controller' => $this->name, 'action' => 'exportSearch'];
?>
<section class="content-header"></section>
<section class="content">
    <search
        :display-fields='<?= json_encode($this->Search->getDisplayFields($tableName)) ?>'
        filters='<?= h(json_encode($this->Search->getFilters($tableName))) ?>'
        id="<?= $searchId ?>"
        search-query="<?= '' !== $searchId ? '' : $searchQuery ?>"
        model="<?= $this->name ?>"
        primary-key="<?= $table->aliasField($table->getPrimaryKey()) ?>"
        user-id="<?= User::getCurrentUser()['id'] ?>"
        :with-batch-delete="<?= $accessFactory->hasAccess($urlBatch, $user) ? 'true' : 'false' ?>"
        :with-batch-edit="<?= $accessFactory->hasAccess($urlBatch, $user) ? 'true' : 'false' ?>"
        :with-export="<?= $accessFactory->hasAccess($urlExport, $user) ? 'true' : 'false' ?>"
    ></search>
</section>
{'fraction_non_alphanumeric': 0.25186440677966104, 'fraction_numerical': 0.001694915254237288, 'mean_word_length': 4.642447418738049, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 95, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '338289', 'n_tokens_mistral': 948, 'n_tokens_neox': 959, 'n_words': 155}