From: Rob Richards Date: Mon, 20 Oct 2003 15:43:02 +0000 (+0000) Subject: Fix bug #25900 (document->get_elements_by_tag_name with default xmlns) X-Git-Tag: php-4.3.4RC2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=36478058f4b13e16b5d3183b9d02dca794e2c568;p=php Fix bug #25900 (document->get_elements_by_tag_name with default xmlns) --- diff --git a/ext/domxml/php_domxml.c b/ext/domxml/php_domxml.c index a76240b2e7..cfb45cc52f 100644 --- a/ext/domxml/php_domxml.c +++ b/ext/domxml/php_domxml.c @@ -3078,11 +3078,11 @@ PHP_FUNCTION(domxml_doc_get_elements_by_tagname) DOMXML_GET_OBJ(contextnodep, contextnode, le_domxmlnodep); } ctxp->node = contextnodep; - str = (char*) emalloc((name_len+3) * sizeof(char)) ; + str = (char*) emalloc((name_len+23) * sizeof(char)) ; if (str == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot allocate memory for string"); } - sprintf(str ,"//%s",name); + sprintf(str ,"//*[local-name() = '%s']", name); xpathobjp = xmlXPathEval(str, ctxp); efree(str);