torrentpier/library/includes/datastore/build_smilies.php
Roman Kelesidis fa7a2c3005
Fixed quote selection for smiles (#1457)
* Fixed quote selection for smiles

* Update CHANGELOG.md
2024-04-26 14:32:40 +07:00

28 lines
913 B
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/**
* TorrentPier Bull-powered BitTorrent tracker engine
*
* @copyright Copyright (c) 2005-2024 TorrentPier (https://torrentpier.com)
* @link https://github.com/torrentpier/torrentpier for the canonical source repository
* @license https://github.com/torrentpier/torrentpier/blob/master/LICENSE MIT License
*/
if (!defined('BB_ROOT')) {
die(basename(__FILE__));
}
global $bb_cfg;
$smilies = [];
$rowset = DB()->fetch_rowset("SELECT * FROM " . BB_SMILIES);
sort($rowset);
foreach ($rowset as $smile) {
$smilies['orig'][] = '#(?<=^|\W)' . preg_quote($smile['code'], '#') . '(?=$|\W)#';
$smilies['repl'][] = ' <img class="smile" src="' . $bb_cfg['smilies_path'] . '/' . $smile['smile_url'] . '" alt="' . $smile['code'] . '" title="' . $smile['emoticon'] . '" align="absmiddle" border="0" />';
$smilies['smile'][] = $smile;
}
$this->store('smile_replacements', $smilies);