Menu

#192 document object always empty

closed
None
2022-04-03
2021-12-12
Tom gugger
No

i'm having a strange problem in simple dom parser. I tried to figure it out but couldn't find the reason .. it occurs when setting an attribute with a bigger HTML file:

$ctl->setAttribute("dtype", "varchar" );

It seems like that the attribute value "varchar" is a reserved word, it also doesn't work when using "double", the name of the attribute is irrelevant. Unfortunately i can't report on how to reproduce the problem, but i attached the html. when using this code:
$doc = str_get_html($html);
echo strlen($doc);

you will get 0 as doc length.

PS: the memory leak problem still exists .. i ran a cronjob which does html parsing for several days and the script was terminated as it was using too much memory, although it shouldn't.

1 Attachments

Discussion

  • Tom gugger

    Tom gugger - 2021-12-12

    ok found out by myself .. i had to increase MAX_FILE_SIZE

     
  • LogMANOriginal

    LogMANOriginal - 2022-04-03
    • status: open --> closed
    • assigned_to: LogMANOriginal
     
  • John Schlick

    John Schlick - 2022-04-03

    varchar is indeed a reserved word in php, and typically, in php " (double quotes) allow for some substitution inside of them, and ' (single quotes) are more literal with no substitution. I don't THINK this is your problem, but try changing to single quotes.

     

Log in to post a comment.