OneSignal is a free push notification service for web and mobile apps. This plugin makes it easy to integrate your website with OneSignal Push Notifications. https://onesignal.com
Other
80
stars
42
forks
source link
fixed apostrophe issue and small ui update to custom push metabox #262
The customer adds apostrophe to any field in the OneSignal settings:
Upon save, a slash gets added before the apostrophes. This happens on every save which leads to a buildup of slashes.
These slashes show up on the prompt and the apostrophe gets translated to HTML version:
Solution
The following two methods are needed together in order for the fix to work:
stripslashes_deep was added to remove slashes automatically added upon saving with an apostrophe. It does not remove slashes added purposely e.g: in UTM params. a side-effect of this workaround is that the apostrophe is converted to HTML version: ' which is why the next function is also needed.
decode_entities was added because without it, apostrophes would show up as the HTML version: '. This function was previously used elsewhere in the plugin.
The Problem:
The customer adds apostrophe to any field in the OneSignal settings:
Upon save, a slash gets added before the apostrophes. This happens on every save which leads to a buildup of slashes.
These slashes show up on the prompt and the apostrophe gets translated to HTML version:
Solution
The following two methods are needed together in order for the fix to work:
stripslashes_deep
was added to remove slashes automatically added upon saving with an apostrophe. It does not remove slashes added purposely e.g: in UTM params. a side-effect of this workaround is that the apostrophe is converted to HTML version:'
which is why the next function is also needed.decode_entities
was added because without it, apostrophes would show up as the HTML version:'
. This function was previously used elsewhere in the plugin.This change is