File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -798,20 +798,19 @@ protected function clean_param_value_sequence(mixed $param): mixed {
798798 * Validation for PARAM_BOOL.
799799 *
800800 * @param mixed $param
801- * @return mixed
801+ * @return bool
802802 */
803- protected function clean_param_value_bool (mixed $ param ): mixed {
804- // Convert to 1 or 0 or bool.
803+ protected function clean_param_value_bool (mixed $ param ): bool {
805804 if (is_bool ($ param )) {
806- return $ param ? true : false ;
805+ return $ param ;
807806 }
808807 $ tempstr = strtolower ((string )$ param );
809- if ($ tempstr === 'on ' || $ tempstr === 'yes ' || $ tempstr === ' true ' ) {
810- $ param = 1 ;
811- } else if ($ tempstr === 'off ' || $ tempstr === 'no ' || $ tempstr === ' false ' ) {
812- $ param = 0 ;
808+ if ($ tempstr === 'on ' || $ tempstr === 'yes ' ) {
809+ $ param = true ;
810+ } else if ($ tempstr === 'off ' || $ tempstr === 'no ' ) {
811+ $ param = false ;
813812 } else {
814- $ param = empty ($ param ) ? 0 : 1 ;
813+ $ param = empty ($ param ) ? false : true ;
815814 }
816815 return $ param ;
817816 }
You can’t perform that action at this time.
0 commit comments