ackwell / ninjabot

Ninjabot is not 'Just Another Bot'
10 stars 8 forks source link

ninjabot: sanitisation, preparation changes #90

Closed gnustomp closed 10 years ago

gnustomp commented 10 years ago

Here's something to mull over. Warning: this code may look scarily compact.

  1. A string can be spliced with [:n] even if the string is shorter than length n.
  2. Using unicode-escape to encode the string helpfully stops escape sequences. However, this may not be what some people want. The difference here is that it does not destroy bad escape sequences, but rather stops them from being bad.
  3. A lot less code.

If you aren't going to merge this, d23a3a3 should probably be reverted.

ackwell commented 10 years ago

Sheesh that's compact.

All looks good, shipping.

ackwell commented 10 years ago

May be worth splitting a call out just for readability' sake, but not required.