Property description
special property is trimmed incorrectly on saving
#5710
Labels
bug
Occurrence of an unintended or unanticipated behaviour that causes a vulnerability or fatal error
PHP 8.3.10, MW 1.39.8, SMW 4.2.0.
An ask query fails silently, showing an exception if debugging is on. The results of the ask query contain Unicode characters, which can be illegal, if some non-Unicode aware string operations had been applied to it.
I have traced the exception, so far, to
includes/MagicWord.php
;MagicWord::matchAndRemove()
.preg_replace_callback()
returnsnull
; which is passed as subject string topreg_replace_callback()
on the next magic word causing an exception.The magic word (
$this->getRegex()
) causing error is/__NOFACTBOX__/iu
(removingu
removes the error but another error happens later again with anull
instead of a string). The$text
is a longish result of a successful SMW query (widetable
format), containing non-Latin characters; and also a�
terminating<span class="smwttcontent">
with a property description. I suspect that the property description had been trimmed incorrectly.The property
Has property description
for one of the queried properties is set to an evidently illegal Unicode string finishing with a�
.UPDATE: The value is set to
{{#set: Has property description = Свойство для хранения регулярного выражения с захватами-селекторами для разбора страницы с форматом <code>text</code>. селекторы в этом случае представляют захваты. Используется в подъобъектах.@ru}}
. However, it is stored asСвойство для хранения регулярного выражения с захватами-селекторами для разбора страницы с форматом <code>text</code>. селекторы в этом случае представляют захваты. Ис�
.It seems to be trimmed somewhere before saving, but trimmed incorrectly, disregarding that it contains non-Latin Unicode sequences.
The text was updated successfully, but these errors were encountered: