OSDN Git Service

git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/plugin@882 1ca29b6e-896d...
[nucleus-jp/nucleus-plugins.git] / NP_UpdatePingServer / trunk / updatepingserver / sharedFunctions.php
1 <?php
2
3 class sharedFunctions
4 {
5
6         function quoteSmart($value)
7         {
8                 if (get_magic_quotes_gpc()) {
9                         $value = stripslashes($value);
10                 }
11                 if (!is_numeric($value)) {
12                         if (version_compare(phpversion(), "4.3.0") == "-1") {
13                                 $value = "'" . mysql_escape_string($value) . "'";
14                         } else {
15                                 $value = "'" . mysql_real_escape_string($value) . "'";
16                         }
17                 } else {
18                         $value     = intval($value);
19                 }
20                 return $value;
21         }
22
23         function _hsc($str)
24         {
25                 return htmlspecialchars($str, ENT_QUOTES, _CHARSET);
26         }
27
28 }