escape to commas and periods in literals

PHP wasn't escaping certain characters in SafeLiteral.