Skip to content

Instantly share code, notes, and snippets.

@nikuuchi
Created January 24, 2012 12:20
Show Gist options
  • Select an option

  • Save nikuuchi/1669964 to your computer and use it in GitHub Desktop.

Select an option

Save nikuuchi/1669964 to your computer and use it in GitHub Desktop.
CodeIgniterでXSS対策のhtmlspecialcharsを使いやすくするだけのhelper
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
if ( ! function_exists('h'))
{
function h($str)
{
return htmlspecialchars($str,ENT_QUOTES,"UTF-8");
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment