ElvenSpellmaker / IRC-Bot

A very little basic IRCBot that is being improved all the time
http://www.wildphp.com
7 stars 1 forks source link

Upper case TITLE breaks title grabbing #6

Closed graymalkin closed 9 years ago

graymalkin commented 9 years ago

Consider using http://php.net/manual/en/simplexmlelement.xpath.php to find the TITLE tag in the DOM.

graymalkin commented 9 years ago
12:26 < graymalkin> http://graymalk.in/test-lc.html
12:26 < wildbot> Title: Testing with lower case title tag
12:26 < graymalkin> http://graymalk.in/test-uc.html
...
ElvenSpellmaker commented 9 years ago

Ugh, people who use upper case letters in HTML tags should die. =|

I'm currently going through the whole bot re-writing bits and doing a massive new version. I'll include that in the new version. =)

ElvenSpellmaker commented 9 years ago

Note to self, change:

if( preg_match('%<title(.*)?>(.*?)</title>%s', $fileContents, $title ) )

to:

if( preg_match('%<title(.*)>(.*?)</title>%is', $fileContents, $title ) )

in URLTitle.php Listener.

ElvenSpellmaker commented 9 years ago

Closed seeing as I'm now using DOMDocument to parse pages which generally works better (for when pages are less than the size limit).

I sill need to fix #9.