$this->objectList->getConditionBuilder()->add('languageItem LIKE ?', ['%' . $this->languageItem . '%']);
}
if ($this->languageItemValue) {
+ $searchValue = '%' . WCF::getDB()->escapeLikeValue($this->languageItemValue) . '%';
$this->objectList->getConditionBuilder()->add(
'((languageUseCustomValue = 0 AND languageItemValue LIKE ?) OR languageCustomItemValue LIKE ?)',
- ['%' . $this->languageItemValue . '%', '%' . $this->languageItemValue . '%']
+ [$searchValue, $searchValue]
);
}
if ($this->hasCustomValue || $this->hasDisabledCustomValue || $this->hasRecentlyDisabledCustomValue) {
return \addslashes($string);
}
+ /**
+ * Escapes a value for use in a `LIKE` condition.
+ *
+ * @since 6.0
+ */
+ public function escapeLikeValue(string $value): string
+ {
+ return \addcslashes($value, "\\%_");
+ }
+
/**
* Returns the sql version.
*