Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #13 from touri/master

#2337 の修正
  • Loading branch information...
commit d9b1b21c0d5ee1c9b3f249a71008352d53a2a8fa 2 parents 223573f + 6a06c0b
@balibali authored
View
9 lib/model/doctrine/PluginDiaryCommentTable.class.php
@@ -69,7 +69,14 @@ protected function addSearchKeywordQuery(Doctrine_Query $q, $keywords)
{
foreach ($keywords as $keyword)
{
- $q->andWhere('body LIKE ?', array('%'.$keyword.'%'));
+ if (method_exists($q, 'andWhereLike'))
+ {
+ $q->andWhereLike('body', array($keyword));
+ }
+ else
+ {
+ $q->andWhere('body LIKE ?', array('%'.$keyword.'%'));
+ }
}
}
}
View
5 lib/model/doctrine/PluginDiaryTable.class.php
@@ -289,6 +289,11 @@ protected function addSearchKeywordQuery(Doctrine_Query $q, $keywords)
{
foreach ($keywords as $keyword)
{
+ if (method_exists($q, 'escapePattern'))
+ {
+ $keyword = $q->escapePattern($keyword);
+ }
+
$q->andWhere('title LIKE ? OR body LIKE ?', array('%'.$keyword.'%', '%'.$keyword.'%'));
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.