File tree Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -7,21 +7,27 @@ function clean_content_type($content_type){
77 return trim (preg_replace ('@;.*@ ' , '' , $ content_type ));
88}
99
10- function starts_with ($ haystack , $ needles ){
11- foreach ( (array )$ needles as $ n ){
12- if ($ n !== '' && stripos ($ haystack , $ n ) === 0 ){
13- return true ;
10+
11+ if (!function_exists ('starts_with ' )){
12+
13+ function starts_with ($ haystack , $ needles ){
14+ foreach ( (array )$ needles as $ n ){
15+ if ($ n !== '' && stripos ($ haystack , $ n ) === 0 ){
16+ return true ;
17+ }
1418 }
19+
20+ return false ;
1521 }
16-
17- return false ;
1822}
1923
20- function str_before ($ subject , $ search ){
21- return $ search === '' ? $ subject : explode ($ search , $ subject )[0 ];
24+ if (!function_exists ('str_before ' )){
25+
26+ function str_before ($ subject , $ search ){
27+ return $ search === '' ? $ subject : explode ($ search , $ subject )[0 ];
28+ }
2229}
2330
24-
2531function is_html ($ content_type ){
2632 return clean_content_type ($ content_type ) == 'text/html ' ;
2733}
You can’t perform that action at this time.
0 commit comments