Permalink
Browse files

Update phpQueryObject.php

Added charset check to parseSelector
  • Loading branch information...
1 parent 00d30fc commit 001807404cdcd8db693237417640a7c564b76c46 @sokal32 sokal32 committed Apr 15, 2014
Showing with 3 additions and 2 deletions.
  1. +3 −2 phpQuery/phpQuery/phpQueryObject.php
@@ -311,9 +311,10 @@ protected function isChar($char) {
protected function parseSelector($query) {
// clean spaces
// TODO include this inside parsing ?
+ $modifier = strtolower(str_replace('-', '', $this->charset)) == 'utf8' ? 'u' : '';
$query = trim(
- preg_replace('@\s+@u', ' ',
- preg_replace('@\s*(>|\\+|~)\s*@u', '\\1', $query)
+ preg_replace('@\s+@' . $modifier, ' ',
+ preg_replace('@\s*(>|\\+|~)\s*@' . $modifier, '\\1', $query)
)
);
$queries = array(array());

0 comments on commit 0018074

Please sign in to comment.