aichingm / rfc2epub

rfc2epub - create an epub ebook from an IETF RFC
Other
20 stars 2 forks source link

Not working with PHP 8.0.7 #4

Closed little-dude closed 3 years ago

little-dude commented 3 years ago

Hello,

Thanks for this neat script! I'd like to use it for RFC 7950 but it crashes:

❯ php rfc2epub 7950 7950.epub 

Warning: Attempt to read property "childNodes" on null in /home/little-dude/rfc2epub/rfc2epub on line 277

Warning: Attempt to read property "length" on null in /home/little-dude/rfc2epub/rfc2epub on line 277

Fatal error: Uncaught Error: Call to a member function getElementsByTagName() on null in /home/little-dude/rfc2epub/rfc2epub:285
Stack trace:
#0 {main}
  thrown in /home/little-dude/rfc2epub/rfc2epub on line 285

❯ php --version              
PHP 8.0.7 (cli) (built: Jun  1 2021 18:43:05) ( ZTS )
Copyright (c) The PHP Group
Zend Engine v4.0.7, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.7, Copyright (c), by Zend Technologies
aichingm commented 3 years ago

Hello @little-dude,

This wasn't an issue with the php version, the ietf changed the url and format of their html files. I just now pushed a fix. Check it out and let me know if it works :wink:

little-dude commented 3 years ago

Works like a charm! Thanks a lot @aichingm, this is such a useful tool.