@@ -103,7 +103,7 @@ public function render(string $view, ?array $options = null, ?bool $saveData = n
103103 }
104104
105105 $ fileExt = pathinfo ($ view , PATHINFO_EXTENSION );
106- $ view = empty ($ fileExt ) ? $ view . '.php ' : $ view ; // allow Views as .html, .tpl, etc (from CI3)
106+ $ view = ($ fileExt === '' ) ? $ view . '.php ' : $ view ; // allow Views as .html, .tpl, etc (from CI3)
107107
108108 $ cacheName = $ options ['cache_name ' ] ?? str_replace ('.php ' , '' , $ view );
109109
@@ -120,8 +120,8 @@ public function render(string $view, ?array $options = null, ?bool $saveData = n
120120 $ fileOrig = $ file ;
121121 $ file = $ this ->loader ->locateFile ($ view , 'Views ' );
122122
123- // locateFile will return an empty string if the file cannot be found.
124- if (empty ( $ file) ) {
123+ // locateFile() will return false if the file cannot be found.
124+ if ($ file === false ) {
125125 throw ViewException::forInvalidFile ($ fileOrig );
126126 }
127127 }
@@ -534,7 +534,7 @@ protected function prepareReplacement(array $matches, string $replace, bool $esc
534534
535535 // Our regex earlier will leave all chained values on a single line
536536 // so we need to break them apart so we can apply them all.
537- $ filters = ! empty ( $ matches [1 ]) ? explode ('| ' , $ matches [1 ]) : [];
537+ $ filters = ( isset ( $ matches [1 ]) && $ matches [ 1 ] !== '' ) ? explode ('| ' , $ matches [1 ]) : [];
538538
539539 if ($ escape && $ filters === [] && ($ context = $ this ->shouldAddEscaping ($ orig ))) {
540540 $ filters [] = "esc( {$ context }) " ;
@@ -589,7 +589,7 @@ protected function applyFilters(string $replace, array $filters): string
589589 preg_match ('/\([\w<>=\/ \\\,:.\-\s\+]+\)/u ' , $ filter , $ param );
590590
591591 // Remove the () and spaces to we have just the parameter left
592- $ param = ! empty ($ param ) ? trim ($ param [0 ], '() ' ) : null ;
592+ $ param = ($ param !== [] ) ? trim ($ param [0 ], '() ' ) : null ;
593593
594594 // Params can be separated by commas to allow multiple parameters for the filter
595595 if ($ param !== null && $ param !== '' ) {
0 commit comments