Skip to content

Commit 8e5b361

Browse files
committed
Update src/Util.php
1 parent 1c93e3f commit 8e5b361

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Util.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ public static function escape_html($src, $nl2br = false) {
909909
if (is_array($src)) {
910910
return array_map([__CLASS__, 'escape_html'], $src);
911911
} else if (is_object($src)) {
912-
return (object)array_map([__CLASS__, 'escape_html'] , object_to_array($src));
912+
return (object)array_map([__CLASS__, 'escape_html'] , self::to_array($src));
913913
} else {
914914
if (is_null($src)) $src = "";
915915
$new_str = is_string($src) ? htmlentities(html_entity_decode($src, ENT_QUOTES)) : $src;
@@ -921,7 +921,7 @@ public static function descape_html($src) {
921921
if (is_array($src)) {
922922
return array_map([__CLASS__, 'descape_html'], $src);
923923
} else if (is_object($src)) {
924-
return (object)array_map([__CLASS__, 'descape_html'], object_to_array($src));
924+
return (object)array_map([__CLASS__, 'descape_html'], self::to_array($src));
925925
} else {
926926
if (is_null($src)) $src = "";
927927
$new_str = is_string($src) ? html_entity_decode($src, ENT_QUOTES) : $src;
@@ -942,29 +942,29 @@ public static function br2nl($text) {
942942
* @param object $object The object to convert
943943
* @reeturn array
944944
*/
945-
public static function object_to_array($object) {
945+
public static function to_array($object) {
946946
if (is_array($object)) return $object;
947947
if (!is_object($object) && !is_array($object)) return $object;
948948
if (is_object($object)) $object = get_object_vars($object);
949949

950950
return array_map([
951951
__CLASS__,
952-
'object_to_array'
952+
'to_array'
953953
], $object);
954954
}
955955
/**
956956
* Convert an array to an object
957957
* @param array $array The array to convert
958958
* @reeturn object
959959
*/
960-
public static function array_to_object($array, $recursive = false) {
960+
public static function to_object($array, $recursive = false) {
961961
if (!is_object($array) && !is_array($array)) return $array;
962962

963963
if (!$recursive) return (object)$array;
964964

965965
if (is_array($array)) return (object)array_map([
966966
__CLASS__,
967-
'array_to_object'
967+
'to_object'
968968
], $array);
969969
else return $array;
970970
}

0 commit comments

Comments
 (0)