Skip to content

Commit e190d02

Browse files
committed
* use mb string function
1 parent f95c677 commit e190d02

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

core/DB/PostgresDialect.class.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,12 @@ public static function toCasted($field, $type)
5454
return "{$field}::{$type}";
5555
}
5656

57-
public static function prepareFullText($words, $logic)
57+
public static function prepareFullText(array $words, $logic)
5858
{
59-
Assert::isArray($words);
60-
6159
$glue = ($logic == DB::FULL_TEXT_AND) ? ' & ' : ' | ';
6260

6361
return
64-
strtolower(
62+
mb_strtolower(
6563
implode(
6664
$glue,
6765
array_map(
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
/* $Id$ */
3+
4+
final class PostgresDialectTest extends TestCase
5+
{
6+
public function testPrepareFullText()
7+
{
8+
$this->assertEquals(
9+
PostgresDialect::prepareFullText(
10+
array('Новый год', 'Снегурочка', 'ПрАзДнИк'),
11+
DB::FULL_TEXT_AND),
12+
"'новый год' & 'снегурочка' & 'праздник'"
13+
);
14+
}
15+
}
16+
?>

0 commit comments

Comments
 (0)