Skip to content
This repository has been archived by the owner on Apr 26, 2020. It is now read-only.

Commit

Permalink
The selector class does not find if the separator is a new line
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSuperStar committed Mar 6, 2018
1 parent 196aa28 commit cfe1a0b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions phpQuery/phpQuery/phpQueryObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ protected function matchClasses($class, $node) {
if ( mb_strpos($class, '.', 1)) {
$classes = explode('.', substr($class, 1));
$classesCount = count( $classes );
$nodeClasses = explode(' ', $node->getAttribute('class') );
$nodeClasses = preg_split("/[\s\t\r\n]+/", $node->getAttribute('class'),-1, PREG_SPLIT_NO_EMPTY);
$nodeClassesCount = count( $nodeClasses );
if ( $classesCount > $nodeClassesCount )
return false;
Expand All @@ -605,7 +605,7 @@ protected function matchClasses($class, $node) {
// strip leading dot from class name
substr($class, 1),
// get classes for element as array
explode(' ', $node->getAttribute('class') )
preg_split("/[\s\t\r\n]+/", $node->getAttribute('class'),-1, PREG_SPLIT_NO_EMPTY)
);
}
}
Expand Down

0 comments on commit cfe1a0b

Please sign in to comment.