Skip to content

Commit 0433653

Browse files
committed
Merge pull request #53 from dovg/dialect-fix
* use mb string function
2 parents bb3c499 + 6eb2390 commit 0433653

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-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(

doc/ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2011-11-21 Evgeny V. Kokovikhin
2+
3+
* core/DB/PostgresDialect.class.php, test/main/PostgresDialectTest.class.php:
4+
use mb_* string function for utf-8 strings.
5+
16
2011-11-18 Sergey S. Sergeev
27

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

0 commit comments

Comments
 (0)