2020 */
2121 function convert_string_utf8_to_vietnamese ($ str = '' )
2222 {
23+ if (empty ($ str )) {
24+ return $ str ;
25+ }
2326 $ str = trim ($ str );
2427 if ($ str !== '' ) {
2528 $ str = str_replace (
@@ -82,6 +85,9 @@ function clean_allowfullscreen($att = '')
8285 */
8386 function clean_text ($ text = '' )
8487 {
88+ if (empty ($ text )) {
89+ return $ text ;
90+ }
8591 $ output = trim ($ text );
8692 if ($ output !== '' ) {
8793 $ output = convert_string_utf8_to_vietnamese ($ output );
@@ -105,8 +111,8 @@ function clean_text($text = '')
105111 */
106112 function clean_title ($ text )
107113 {
108- if ($ text === null ) {
109- return null ;
114+ if (empty ( $ text) ) {
115+ return $ text ;
110116 }
111117 $ output = trim ($ text );
112118 if ($ output !== '' ) {
@@ -125,16 +131,19 @@ function clean_title($text)
125131 /**
126132 * Function clean_text_mobile
127133 *
128- * @param string $att
134+ * @param string $text
129135 *
130136 * @return string|string[]
131137 * @author : 713uk13m <dev@nguyenanhung.com>
132138 * @copyright: 713uk13m <dev@nguyenanhung.com>
133139 * @time : 12/10/2020 36:37
134140 */
135- function clean_text_mobile ($ att = '' )
141+ function clean_text_mobile ($ text = '' )
136142 {
137- $ output = $ att ;
143+ if (empty ($ text )) {
144+ return $ text ;
145+ }
146+ $ output = $ text ;
138147 if ($ output !== '' ) {
139148 $ output = clean_text ($ output );
140149 $ output = str_replace (
@@ -169,6 +178,9 @@ function clean_text_mobile($att = '')
169178 */
170179 function bodautru ($ string = '' )
171180 {
181+ if (empty ($ string )) {
182+ return $ string ;
183+ }
172184 $ output = $ string ;
173185 if ($ output !== '' ) {
174186 $ output = str_replace ('- ' , '' , $ output );
@@ -190,6 +202,9 @@ function bodautru($string = '')
190202 */
191203 function bodaunhay ($ string = '' )
192204 {
205+ if (empty ($ string )) {
206+ return $ string ;
207+ }
193208 $ output = $ string ;
194209 if ($ output !== '' ) {
195210 $ output = str_replace (array ('" ' , "' " ), '' , $ output );
@@ -211,6 +226,9 @@ function bodaunhay($string = '')
211226 */
212227 function searchs_snippets ($ keywords = '' )
213228 {
229+ if (empty ($ keywords )) {
230+ return $ keywords ;
231+ }
214232 $ output = $ keywords ;
215233 if ($ output !== '' ) {
216234 $ output = urldecode ($ output );
@@ -235,6 +253,9 @@ function searchs_snippets($keywords = '')
235253 */
236254 function tags_snippets ($ tags = '' )
237255 {
256+ if (empty ($ tags )) {
257+ return $ tags ;
258+ }
238259 $ output = $ tags ;
239260 if ($ output !== '' ) {
240261 $ output = urldecode ($ output );
@@ -260,6 +281,9 @@ function tags_snippets($tags = '')
260281 */
261282 function tags_clean ($ tags = '' )
262283 {
284+ if (empty ($ tags )) {
285+ return $ tags ;
286+ }
263287 $ output = $ tags ;
264288 if ($ output !== '' ) {
265289 $ output = urldecode ($ output );
0 commit comments