Skip to content

Commit

Permalink
Release next-gen version v1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
hungnguyenhp committed Sep 26, 2023
1 parent fd83d39 commit 2e73496
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 25 deletions.
55 changes: 31 additions & 24 deletions helpers/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
function is_php($version)
{
static $_is_php;
$version = (string) $version;
$version = (string)$version;

if (!isset($_is_php[$version])) {
$_is_php[$version] = version_compare(PHP_VERSION, $version, '>=');
Expand All @@ -34,12 +34,12 @@ function is_php($version)
/**
* Function escapeHtml
*
* @author: 713uk13m <dev@nguyenanhung.com>
* @time : 2018-12-09 14:24
*
* @param mixed $string
*
* @return mixed
* @author: 713uk13m <dev@nguyenanhung.com>
* @time : 2018-12-09 14:24
*
*/
function escapeHtml($string)
{
Expand Down Expand Up @@ -74,12 +74,12 @@ function htmlEscape($string)
/**
* Function escapeHtmlAttr
*
* @author: 713uk13m <dev@nguyenanhung.com>
* @time : 2018-12-09 14:24
*
* @param mixed $string
*
* @return mixed
* @author: 713uk13m <dev@nguyenanhung.com>
* @time : 2018-12-09 14:24
*
*/
function escapeHtmlAttr($string)
{
Expand Down Expand Up @@ -114,12 +114,12 @@ function escapeHtmlAttribute($string)
/**
* Function escapeJs
*
* @author: 713uk13m <dev@nguyenanhung.com>
* @time : 2018-12-09 14:25
*
* @param mixed $string
*
* @return mixed
* @author: 713uk13m <dev@nguyenanhung.com>
* @time : 2018-12-09 14:25
*
*/
function escapeJs($string)
{
Expand Down Expand Up @@ -190,12 +190,12 @@ function escapeCss($string)
/**
* Function escapeUrl
*
* @author: 713uk13m <dev@nguyenanhung.com>
* @time : 2018-12-09 14:25
*
* @param mixed $string
*
* @return mixed
* @author: 713uk13m <dev@nguyenanhung.com>
* @time : 2018-12-09 14:25
*
*/
function escapeUrl($string)
{
Expand All @@ -214,7 +214,7 @@ function escapeUrl($string)
* between ascii characters, like Java\0script.
*
* @param mixed $str
* @param bool $urlEncoded
* @param bool $urlEncoded
*
* @return string
*/
Expand Down Expand Up @@ -331,7 +331,7 @@ function escape_url($string)
* between ascii characters, like Java\0script.
*
* @param mixed $str
* @param bool $urlEncoded
* @param bool $urlEncoded
*
* @return string
*/
Expand Down Expand Up @@ -363,8 +363,8 @@ function remove_invisible_characters($str, $urlEncoded = true)
* vulnerabilities along with a few other hacks I've
* harvested from examining vulnerabilities in other programs.
*
* @param string|string[] $str Input data
* @param bool $isImage Whether the input is an image
* @param string|string[] $str Input data
* @param bool $isImage Whether the input is an image
*
* @return array|bool|string|string[]|null
*/
Expand All @@ -377,13 +377,13 @@ function _xss_clean_($str, $isImage = false)
/**
* Hash encode a string
*
* @todo Remove in version 3.1+.
* @deprecated 3.0.0 Use PHP's native hash() instead.
*
* @param string $str
* @param string $type = 'sha1'
*
* @return string
* @deprecated 3.0.0 Use PHP's native hash() instead.
*
* @todo Remove in version 3.1+.
*/
function do_hash($str, $type = 'sha1')
{
Expand Down Expand Up @@ -446,8 +446,8 @@ function stripImageTags($str)
/**
* Sanitize Filename
*
* @param string $str Input file name
* @param bool $relative_path Whether to preserve paths
* @param string $str Input file name
* @param bool $relative_path Whether to preserve paths
*
* @return string
*/
Expand All @@ -460,8 +460,8 @@ function sanitize_filename($str, $relative_path = false)
/**
* Sanitize Filename
*
* @param string $str Input file name
* @param bool $relative_path Whether to preserve paths
* @param string $str Input file name
* @param bool $relative_path Whether to preserve paths
*
* @return string
*/
Expand All @@ -480,3 +480,10 @@ function bear_framework_basic_clean_str($str = '')
return trim($str);
}
}
if (!function_exists('bear_framework_entity_decode')) {
function bear_framework_entity_decode($str = '', $charset = null)
{
$es = new nguyenanhung\Libraries\Escape\Escape();
return $es->entityDecode($str, $charset);
}
}
2 changes: 1 addition & 1 deletion src/Escape.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/
class Escape
{
const VERSION = '1.1.1';
const VERSION = '1.1.2';

/**
* Character set
Expand Down

0 comments on commit 2e73496

Please sign in to comment.