mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 12:28:52 +00:00
[ticket/15348] Ignore smilies that are immediately followed by a word
PHPBB3-15348
This commit is contained in:
parent
1e605efaf1
commit
837dc9b3a7
4 changed files with 38 additions and 0 deletions
|
@ -323,6 +323,9 @@ class factory implements \phpbb\textformatter\cache_interface
|
||||||
// Only parse emoticons at the beginning of the text or if they're preceded by any
|
// Only parse emoticons at the beginning of the text or if they're preceded by any
|
||||||
// one of: a new line, a space, a dot, or a right square bracket
|
// one of: a new line, a space, a dot, or a right square bracket
|
||||||
$configurator->Emoticons->notAfter = '[^\\n .\\]]';
|
$configurator->Emoticons->notAfter = '[^\\n .\\]]';
|
||||||
|
|
||||||
|
// Ignore emoticons that are immediately followed by a "word" character
|
||||||
|
$configurator->Emoticons->notBefore = '\\w';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load the censored words
|
// Load the censored words
|
||||||
|
|
1
tests/text_processing/tickets_data/PHPBB3-15348.html
Normal file
1
tests/text_processing/tickets_data/PHPBB3-15348.html
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<img class="smilies" src="phpBB/images/smilies/icon_e_surprised.gif" width="15" height="17" alt=":o" title="First half of :ok:"> <img class="smilies" src="phpBB/images/smilies/icon_lol.gif" width="15" height="17" alt="k:" title="Second half of :ok:"> <img alt=":ok:" class="emoji smilies" draggable="false" src="//cdn.jsdelivr.net/emojione/assets/svg/1f197.svg">
|
1
tests/text_processing/tickets_data/PHPBB3-15348.txt
Normal file
1
tests/text_processing/tickets_data/PHPBB3-15348.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
:o k: :ok:
|
33
tests/text_processing/tickets_data/PHPBB3-15348.xml
Normal file
33
tests/text_processing/tickets_data/PHPBB3-15348.xml
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<dataset>
|
||||||
|
<table name="phpbb_smilies">
|
||||||
|
<column>smiley_id</column>
|
||||||
|
<column>code</column>
|
||||||
|
<column>emotion</column>
|
||||||
|
<column>smiley_url</column>
|
||||||
|
<column>smiley_width</column>
|
||||||
|
<column>smiley_height</column>
|
||||||
|
<column>smiley_order</column>
|
||||||
|
<column>display_on_posting</column>
|
||||||
|
<row>
|
||||||
|
<value>13</value>
|
||||||
|
<value>:o</value>
|
||||||
|
<value>First half of :ok:</value>
|
||||||
|
<value>icon_e_surprised.gif</value>
|
||||||
|
<value>15</value>
|
||||||
|
<value>17</value>
|
||||||
|
<value>14</value>
|
||||||
|
<value>1</value>
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<value>99</value>
|
||||||
|
<value>k:</value>
|
||||||
|
<value>Second half of :ok:</value>
|
||||||
|
<value>icon_lol.gif</value>
|
||||||
|
<value>15</value>
|
||||||
|
<value>17</value>
|
||||||
|
<value>22</value>
|
||||||
|
<value>1</value>
|
||||||
|
</row>
|
||||||
|
</table>
|
||||||
|
</dataset>
|
Loading…
Add table
Reference in a new issue