Skip to content

Instantly share code, notes, and snippets.


tommcfarlin/00-saving-data.php Secret

Created Jun 14, 2018
What would you like to do?
[WordPress][PHP] Sanitizing URLs in WordPress with Its API and PHP
$data['url'] = '<script type="text/javascript">alert(\'hello world!\');</script>';
if (!isset($data['url']) {
return '';
$url = $data['url'];
$data['url'] = strip_tags(
filter_var($url, FILTER_VALIDATE_URL)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment