]> granicus.if.org Git - php/commitdiff
Fix bug #25900 (document->get_elements_by_tag_name with default xmlns)
authorRob Richards <rrichards@php.net>
Mon, 20 Oct 2003 15:43:02 +0000 (15:43 +0000)
committerRob Richards <rrichards@php.net>
Mon, 20 Oct 2003 15:43:02 +0000 (15:43 +0000)
ext/domxml/php_domxml.c

index a76240b2e77ecb4081cf3138b325d7a951c9124f..cfb45cc52f074172cc90892ba2dd988aa5495b8b 100644 (file)
@@ -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);