浏览代码

[CssSelector] removed the use of lower-case() in XPath as it is not supported by PHP

Fabien Potencier 15 年之前
父节点
当前提交
1b9fee18d4
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      src/Symfony/Components/CssSelector/Node/FunctionNode.php

+ 5 - 1
src/Symfony/Components/CssSelector/Node/FunctionNode.php

@@ -170,7 +170,11 @@ class FunctionNode implements NodeInterface
     {
       $expr = $expr->formatElement();
     }
-    $xpath->addCondition(sprintf('contains(css:lower-case(string(.)), %s)', XPathExpr::xpathLiteral(strtolower($expr))));
+
+    // FIXME: lower-case is only available with XPath 2
+    //$xpath->addCondition(sprintf('contains(lower-case(string(.)), %s)', XPathExpr::xpathLiteral(strtolower($expr))));
+    $xpath->addCondition(sprintf('contains(string(.), %s)', XPathExpr::xpathLiteral($expr)));
+
     // FIXME: Currently case insensitive matching doesn't seem to be happening
 
     return $xpath;