Skip to content
Snippets Groups Projects
Commit 609e15e6 authored by Martin Stjernholm's avatar Martin Stjernholm
Browse files

Come to think of it, there were more bugs in the same area.

(There are tests for this, but they're currently in the Roxen
WebServer test suite.)

Rev: lib/modules/Parser.pmod/XML.pmod/SloppyDOM.pmod:1.5
parent 5b927a01
Branches
Tags
No related merge requests found
// $Id: SloppyDOM.pmod,v 1.4 2010/06/30 09:08:40 mast Exp $ // $Id: SloppyDOM.pmod,v 1.5 2010/06/30 10:01:59 mast Exp $
#pike __REAL_VERSION__ #pike __REAL_VERSION__
...@@ -784,22 +784,21 @@ static class NodeWithChildElements ...@@ -784,22 +784,21 @@ static class NodeWithChildElements
if (mixed pred_res = elem->simple_path_recur (pred_expr, 0, 0)) { if (mixed pred_res = elem->simple_path_recur (pred_expr, 0, 0)) {
if (arrayp (pred_res)) { if (arrayp (pred_res)) {
foreach (pred_res, mapping(string:string)|Node pred_node) { foreach (pred_res, mapping(string:string)|Node pred_node) {
if (objectp (pred_node) && if (mappingp (pred_node)) {
pred_node->get_text_content() == value) { if (search (pred_node, value)) {
filtered_res += ({elem}); filtered_res += ({elem});
continue res_loop; continue res_loop;
} }
}
else else
foreach (pred_node;; string attr_val) { if (pred_node->get_text_content() == value) {
if (attr_val == value) {
filtered_res += ({elem}); filtered_res += ({elem});
continue res_loop; continue res_loop;
} }
} }
} }
}
else if (mappingp (pred_res)) { else if (mappingp (pred_res)) {
if (values (pred_res)[0] == value) { if (search (pred_res, value)) {
filtered_res += ({elem}); filtered_res += ({elem});
continue res_loop; continue res_loop;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment