ironman5366 / W.I.L.L

A python written personal assistant
https://willbeddow.com
MIT License
377 stars 58 forks source link

Entering "cnn" breaks everything & makes the script hang/freeze. #24

Closed Rich700000000000 closed 8 years ago

Rich700000000000 commented 8 years ago

I entered "cnn", all lowercase, into slack. The script responded by printing 2,000 characters of random HTML and hanging, but not before sending an error TO SLACK, and filling it up with errors and HTML.

Just, why...

brenttaylor commented 8 years ago

Looks like input is being parsed but not validated. That's a problem and needs to be fixed. However if you type "cnn " it works for now. @ironman5366 You up for fixing this?

ironman5366 commented 8 years ago

I'll check it out.

ironman5366 commented 8 years ago

Ok so I figured out what happened. When W.I.L.L doesn't detect a plugin or anything he can use, he runs it through the search module. That led him to check the cnn page. As referenced at https://github.com/ironman5366/W.I.L.L/issues/18, right now the html parsing is just an example and fairly awful. It just searches for a paragraph tag, but he didn't find one on that page so the error was that the search function didn't return anything. A quick fix would just to be have the search function return something that said nothing found upon that occasion, I'll do so now.

ironman5366 commented 8 years ago

Fixed with https://github.com/ironman5366/W.I.L.L/commit/a9ab5881c98a1a7dd60a36703556362c7387fd56