Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51456 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 22788 invoked from network); 17 Feb 2011 15:29:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Feb 2011 15:29:42 -0000 Authentication-Results: pb1.pair.com smtp.mail=fxmulder@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=fxmulder@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: fxmulder@gmail.com X-Host-Fingerprint: 209.85.214.170 mail-iw0-f170.google.com Received: from [209.85.214.170] ([209.85.214.170:46250] helo=mail-iw0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2B/E6-16134-5EE3D5D4 for ; Thu, 17 Feb 2011 10:29:41 -0500 Received: by iwn6 with SMTP id 6so2712226iwn.29 for ; Thu, 17 Feb 2011 07:29:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=uYkSEHI0w/+Db0GkutV+SKEprgpT9zPwZMH2/pKv5Eg=; b=cpsFwxTsUVWiP7Kt19BULEDgr0mbsr7MPuSrMeji+nXqQo3Z7/Pzp/AEAjQid837Im Og2IfBfbBo5PNbNpzt5z0x5+GC/J7wHsas7rZuKPCevJ8v+UACwFxZIMvdTa2vfeOKQ8 Bu0rB/Kd2ktHwhrsSdKslFaK6si1f51FQ2XGA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=TPiiBMJQzmNguQ1i7BZugFuNHLq/TAYOPlLir9y88MCeCHcUpa++/lRyrF7oeqqzqJ XhqDiSA88etvcF/6TAiTNvVfjVolHbR+C/y1ybefDzKvZ2wPt/hoJp2zYjgFHVPxUkAm ptbkJ1++qlZ8W0Q8l/TLm06zk/6bSf94xLVGs= MIME-Version: 1.0 Received: by 10.42.213.74 with SMTP id gv10mr3026675icb.213.1297956578492; Thu, 17 Feb 2011 07:29:38 -0800 (PST) Received: by 10.42.140.134 with HTTP; Thu, 17 Feb 2011 07:29:38 -0800 (PST) In-Reply-To: References: Date: Thu, 17 Feb 2011 08:29:38 -0700 Message-ID: To: Pierre Joye Cc: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] PHP Patch for loadHTML options From: fxmulder@gmail.com (James Devine) Will do, thanks! On Thu, Feb 17, 2011 at 6:43 AM, Pierre Joye wrote: > hi, > > Can you make a patch against trunk instead please? > > Also pls follow the CS: > > if (foo) { > } > > Ideally attach your patch to a feature request at bugs.php.net, so we > won't loose it :) > > thanks for your work! > > Cheers, > > On Thu, Feb 17, 2011 at 12:57 AM, James Devine wrote= : >> I've included a patch for review adding the ability to optionally pass >> options to the DOMDocument::loadHTML[File] functions >> >> >> diff -ru php-5.3.5.orig/ext/dom/document.c php-5.3.5.new/ext/dom/documen= t.c >> --- php-5.3.5.orig/ext/dom/document.c =A0 2010-04-02 14:08:15.000000000 = -0600 >> +++ php-5.3.5.new/ext/dom/document.c =A0 =A02011-02-16 16:49:20.00000000= 0 -0700 >> @@ -149,10 +149,12 @@ >> >> =A0ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_loadhtml, 0, 0, 1) >> =A0 =A0 =A0 =A0ZEND_ARG_INFO(0, source) >> + =A0 =A0 =A0 ZEND_ARG_INFO(0, options) >> =A0ZEND_END_ARG_INFO(); >> >> =A0ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_loadhtmlfile, 0, 0, 1) >> =A0 =A0 =A0 =A0ZEND_ARG_INFO(0, source) >> + =A0 =A0 =A0 ZEND_ARG_INFO(0, options) >> =A0ZEND_END_ARG_INFO(); >> >> =A0ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_savehtml, 0, 0, 0) >> @@ -2157,10 +2159,11 @@ >> =A0 =A0 =A0 =A0char *source; >> =A0 =A0 =A0 =A0int source_len, refcount, ret; >> =A0 =A0 =A0 =A0htmlParserCtxtPtr ctxt; >> + =A0 =A0 =A0 int options =3D 0; >> >> =A0 =A0 =A0 =A0id =3D getThis(); >> >> - =A0 =A0 =A0 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", >> &source, &source_len) =3D=3D FAILURE) { >> + =A0 =A0 =A0 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l"= , >> &source, &source_len, &options) =3D=3D FAILURE) { >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return; >> =A0 =A0 =A0 =A0} >> >> @@ -2180,6 +2183,9 @@ >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0RETURN_FALSE; >> =A0 =A0 =A0 =A0} >> >> + =A0 =A0 =A0 if(options) >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 htmlCtxtUseOptions(ctxt, options); >> + >> =A0 =A0 =A0 =A0ctxt->vctxt.error =3D php_libxml_ctx_error; >> =A0 =A0 =A0 =A0ctxt->vctxt.warning =3D php_libxml_ctx_warning; >> =A0 =A0 =A0 =A0if (ctxt->sax !=3D NULL) { >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> > > > > -- > Pierre > > @pierrejoye | http://blog.thepimp.net | http://www.libgd.org >