Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Update phpQueryObject.php #1

Merged
merged 2 commits into from

2 participants

Shutko Vitaly Fotis Alexandrou
Shutko Vitaly

Fixed bug with cyrillic symbols in selectors

sokal32 added some commits
Shutko Vitaly sokal32 Update phpQueryObject.php
Fixed bug with cyrillic symbols in selectors
00d30fc
Shutko Vitaly sokal32 Update phpQueryObject.php
Added charset check to parseSelector
0018074
Fotis Alexandrou falexandrou merged commit d4952ff into from
Fotis Alexandrou
Collaborator

Looks good :+1:

Sorry for the late merge :shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 14, 2014
  1. Shutko Vitaly

    Update phpQueryObject.php

    sokal32 authored
    Fixed bug with cyrillic symbols in selectors
Commits on Apr 15, 2014
  1. Shutko Vitaly

    Update phpQueryObject.php

    sokal32 authored
    Added charset check to parseSelector
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 2 deletions.
  1. +3 −2 phpQuery/phpQuery/phpQueryObject.php
5 phpQuery/phpQuery/phpQueryObject.php
View
@@ -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+@', ' ',
- preg_replace('@\s*(>|\\+|~)\s*@', '\\1', $query)
+ preg_replace('@\s+@' . $modifier, ' ',
+ preg_replace('@\s*(>|\\+|~)\s*@' . $modifier, '\\1', $query)
)
);
$queries = array(array());
Something went wrong with that request. Please try again.