<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>Need short call to remove all HTML TAG because of memory problem</title>
        <description>Hi,

I want to remove all HTML tags from HTML pages.

I'd like to know if there is a better way than making this call : 


require_once('htmlpurifier/library/HTMLPurifier.auto.php');
$config = HTMLPurifier_Config::createDefault();
$config-&amp;gt;set('HTML', 'Allowed', ''); // Allow Nothing
$purifier = new HTMLPurifier($config);
return $purifier-&amp;gt;purify($html);


I get :


Fatal error: Allowed memory size of 52428800 bytes exhausted (tried to allocate 71 bytes) in /home/httpd/htdocs/lib/htmlpurifier-4.3.0/library/HTMLPurifier/Lexer/DOMLex.php on line 177

Call Stack:
   89.4199   15980456   1. scanWords-&amp;gt;extractText() /home/httpd/htdocs/test/scanWords.php:287
   89.4343   16653936   2. HTMLPurifier-&amp;gt;purify() /home/httpd/htdocs/test/scanWords.php:648
   89.4351   16668952   3. HTMLPurifier_Lexer_DOMLex-&amp;gt;tokenizeHTML() /home/httpd/htdocs/lib/htmlpurifier-4.3.0/library/HTMLPurifier.php:179
   91.2438   18272472   4. HTMLPurifier_Lexer_DOMLex-&amp;gt;tokenizeDOM() /home/httpd/htdocs/lib/htmlpurifier-4.3.0/library/HTMLPurifier/Lexer/DOMLex.php:70
   91.7585   52386104   5. HTMLPurifier_Lexer_DOMLex-&amp;gt;createEndNode() /home/httpd/htdocs/lib/htmlpurifier-4.3.0/library/HTMLPurifier/Lexer/DOMLex.php:105


The page tested was a 580 Ko page size.
My admin team do not want to change the configuration of the PHP memory allocation.

So may be could I call Purifier in a lighter way to get same result ? (only text!)

Any idea are welcome.

Thanks per advance.</description>
        <link>http://htmlpurifier.org/phorum/read.php?3,5497,5497#msg-5497</link>
        <lastBuildDate>Thu, 23 May 2013 03:39:54 -0400</lastBuildDate>
        <generator>Phorum 5.2.18</generator>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,5497,5501#msg-5501</guid>
            <title>Re: Need short call to remove all HTML TAG because of memory problem</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,5497,5501#msg-5501</link>
            <description><![CDATA[<p>Ok thanks for your answer ... DirectLex do not changed anything ... so yes init_set solved it ... but I'm not so happy with this ...
Thanks again for your reactivity!</p>]]></description>
            <dc:creator>footcow</dc:creator>
            <category>Support</category>
            <pubDate>Thu, 07 Apr 2011 13:58:08 -0400</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,5497,5500#msg-5500</guid>
            <title>Re: Need short call to remove all HTML TAG because of memory problem</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,5497,5500#msg-5500</link>
            <description><![CDATA[<p>You're running out of memory in the tokenization stage, so it's the internal representation of the HTML that's killing you. You might have some luck setting <a href="/live/configdoc/plain.html#Core.LexerImpl">%Core.LexerImpl</a> to DirectLex, or try using ini_set to bump the memory limit, but otherwise, you're out of luck.</p>]]></description>
            <dc:creator>Ambush Commander</dc:creator>
            <category>Support</category>
            <pubDate>Thu, 07 Apr 2011 11:46:03 -0400</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,5497,5499#msg-5499</guid>
            <title>Re: Need short call to remove all HTML TAG because of memory problem</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,5497,5499#msg-5499</link>
            <description><![CDATA[<p>Ambush Commander said :
</p>

<blockquote cite="Ambush%20Commander">
<p>striptags and then htmlentities.</p>
</blockquote>

<p>??? no ... I want to leave correctly as is doing perfeclty Purifier the scripts and other malformed tags.
PHP strip_tags functions is so buggy ! I can't use them ...</p>

<p>What I really want to know is there is any option to not going throught filters for example, or accessing just to the earth call of cleanning tags in Purifier (to get less memory usage). This tool is so good ... and works better than php functions.</p>

<p>Please you migh you this ...</p>]]></description>
            <dc:creator>footcow</dc:creator>
            <category>Support</category>
            <pubDate>Thu, 07 Apr 2011 11:41:10 -0400</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,5497,5498#msg-5498</guid>
            <title>Re: Need short call to remove all HTML TAG because of memory problem</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,5497,5498#msg-5498</link>
            <description><![CDATA[<p>striptags and then htmlentities.</p>]]></description>
            <dc:creator>Ambush Commander</dc:creator>
            <category>Support</category>
            <pubDate>Thu, 07 Apr 2011 11:29:39 -0400</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,5497,5497#msg-5497</guid>
            <title>Need short call to remove all HTML TAG because of memory problem</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,5497,5497#msg-5497</link>
            <description><![CDATA[<p>Hi,</p>

<p>I want to remove all HTML tags from HTML pages.</p>

<p>I'd like to know if there is a better way than making this call : </p>

<pre>
require_once('htmlpurifier/library/HTMLPurifier.auto.php');
$config = HTMLPurifier_Config::createDefault();
$config-&gt;set('HTML', 'Allowed', ''); // Allow Nothing
$purifier = new HTMLPurifier($config);
return $purifier-&gt;purify($html);
</pre>

<p>I get :</p>

<pre>
Fatal error: Allowed memory size of 52428800 bytes exhausted (tried to allocate 71 bytes) in /home/httpd/htdocs/lib/htmlpurifier-4.3.0/library/HTMLPurifier/Lexer/DOMLex.php on line 177

Call Stack:
   89.4199   15980456   1. scanWords-&gt;extractText() /home/httpd/htdocs/test/scanWords.php:287
   89.4343   16653936   2. HTMLPurifier-&gt;purify() /home/httpd/htdocs/test/scanWords.php:648
   89.4351   16668952   3. HTMLPurifier_Lexer_DOMLex-&gt;tokenizeHTML() /home/httpd/htdocs/lib/htmlpurifier-4.3.0/library/HTMLPurifier.php:179
   91.2438   18272472   4. HTMLPurifier_Lexer_DOMLex-&gt;tokenizeDOM() /home/httpd/htdocs/lib/htmlpurifier-4.3.0/library/HTMLPurifier/Lexer/DOMLex.php:70
   91.7585   52386104   5. HTMLPurifier_Lexer_DOMLex-&gt;createEndNode() /home/httpd/htdocs/lib/htmlpurifier-4.3.0/library/HTMLPurifier/Lexer/DOMLex.php:105
</pre>

<p>The page tested was a 580 Ko page size.
My admin team do not want to change the configuration of the PHP memory allocation.</p>

<p>So may be could I call Purifier in a lighter way to get same result ? (only text!)</p>

<p>Any idea are welcome.</p>

<p>Thanks per advance.</p>]]></description>
            <dc:creator>footcow</dc:creator>
            <category>Support</category>
            <pubDate>Thu, 07 Apr 2011 11:15:14 -0400</pubDate>
        </item>
    </channel>
</rss>
