mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-06-26 03:30:48 +03:00
Теперь в автоподстановке тегов не учитывается регистр + добавлено переопределение mb_strtolower()
This commit is contained in:
parent
c45b23b4fe
commit
755fec7f61
|
@ -854,7 +854,7 @@ class ActionBlog extends Action {
|
|||
* Проверяем текст комментария
|
||||
*/
|
||||
$sText=$this->Text_Parser(getRequest('comment_text'));
|
||||
if (!func_check($sText,'text',2,3000)) {
|
||||
if (!func_check($sText,'text',2,10000)) {
|
||||
$this->Message_AddError('Текст комментария должен быть от 2 до 3000 символов и не содержать разного рода каку','Ошибка');
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -547,12 +547,13 @@ class Mapper_Topic extends Mapper {
|
|||
}
|
||||
|
||||
public function GetTopicTagsByLike($sTag,$iLimit) {
|
||||
$sTag=mb_strtolower($sTag,"UTF-8");
|
||||
$sql = "SELECT
|
||||
topic_tag_text
|
||||
FROM
|
||||
".DB_TABLE_TOPIC_TAG."
|
||||
WHERE
|
||||
topic_tag_text LIKE ?
|
||||
LOWER(topic_tag_text) LIKE ?
|
||||
GROUP BY
|
||||
topic_tag_text
|
||||
LIMIT 0, ?d
|
||||
|
|
|
@ -288,12 +288,13 @@ class Mapper_User extends Mapper {
|
|||
}
|
||||
|
||||
public function GetUsersByLoginLike($sUserLogin,$iLimit) {
|
||||
$sUserLogin=mb_strtolower($sUserLogin,"UTF-8");
|
||||
$sql = "SELECT
|
||||
user_login
|
||||
FROM
|
||||
".DB_TABLE_USER."
|
||||
WHERE
|
||||
user_login LIKE ?
|
||||
LOWER(user_login) LIKE ?
|
||||
and
|
||||
user_activate = 1
|
||||
LIMIT 0, ?d
|
||||
|
|
|
@ -22,11 +22,23 @@
|
|||
* @return unknown
|
||||
*/
|
||||
if (!function_exists('mb_strlen')) {
|
||||
function mb_strlen($s) {
|
||||
return strlen($s);
|
||||
function mb_strlen($s,$sEncode="UTF-8") {
|
||||
$length = strlen(iconv($sEncode, 'Windows-1251', $s));
|
||||
return (int)$length;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Если не стоит расширения mb
|
||||
*/
|
||||
if (!function_exists('mb_strtolower')) {
|
||||
function mb_strtolower($s,$sEncode="UTF-8") {
|
||||
$s=iconv($sEncode,"Windows-1251",$s);
|
||||
$s=strtolower($s);
|
||||
$s=iconv("Windows-1251",$sEncode,$s);
|
||||
return $s;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* функция вывода отладочных сообщений через "хакерскую" консоль Дмитрия Котерова
|
||||
|
|
Loading…
Reference in a new issue