5757 /**
5858 * Determines if the current version of PHP is equal to or greater than the supplied value
5959 *
60- * @param string
60+ * @param string $version
6161 * @return bool TRUE if the current version is $version or higher
6262 */
6363 function is_php ($ version )
@@ -112,7 +112,7 @@ function is_linux()
112112 * on Unix servers if safe_mode is on.
113113 *
114114 * @link https://bugs.php.net/bug.php?id=54709
115- * @param string
115+ * @param string $file
116116 * @return bool
117117 */
118118 function is_really_writable ($ file )
@@ -160,9 +160,9 @@ function is_really_writable($file)
160160 * exist it is instantiated and set to a static variable. If it has
161161 * previously been instantiated the variable is returned.
162162 *
163- * @param string the class name being requested
164- * @param string the directory where the class should be found
165- * @param mixed an optional argument to pass to the class constructor
163+ * @param string $class the class name being requested
164+ * @param string $directory the directory where the class should be found
165+ * @param mixed $param an optional argument to pass to the class constructor
166166 * @return object
167167 */
168168 function &load_class ($ class , $ directory = 'libraries ' , $ param = NULL )
@@ -233,7 +233,7 @@ function &load_class($class, $directory = 'libraries', $param = NULL)
233233 * Keeps track of which libraries have been loaded. This function is
234234 * called by the load_class() function above
235235 *
236- * @param string
236+ * @param string $class
237237 * @return array
238238 */
239239 function &is_loaded ($ class = '' )
@@ -259,10 +259,10 @@ function &is_loaded($class = '')
259259 * This function lets us grab the config file even if the Config class
260260 * hasn't been instantiated yet
261261 *
262- * @param array
262+ * @param array $replace
263263 * @return array
264264 */
265- function &get_config (Array $ replace = array ())
265+ function &get_config (array $ replace = array ())
266266 {
267267 static $ config ;
268268
@@ -314,7 +314,7 @@ function &get_config(Array $replace = array())
314314 /**
315315 * Returns the specified config item
316316 *
317- * @param string
317+ * @param string $item
318318 * @return mixed
319319 */
320320 function config_item ($ item )
@@ -427,9 +427,9 @@ function is_cli()
427427 * This function will send the error page directly to the
428428 * browser and exit.
429429 *
430- * @param string
431- * @param int
432- * @param string
430+ * @param string $message
431+ * @param int|float $status_code
432+ * @param string $heading
433433 * @return void
434434 */
435435 function show_error ($ message , $ status_code = 500 , $ heading = 'An Error Was Encountered ' )
@@ -462,8 +462,8 @@ function show_error($message, $status_code = 500, $heading = 'An Error Was Encou
462462 * However, instead of the standard error template it displays
463463 * 404 errors.
464464 *
465- * @param string
466- * @param bool
465+ * @param string $page
466+ * @param bool $log_error
467467 * @return void
468468 */
469469 function show_404 ($ page = '' , $ log_error = TRUE )
@@ -484,8 +484,8 @@ function show_404($page = '', $log_error = TRUE)
484484 * We use this as a simple mechanism to access the logging
485485 * class and send messages to be logged.
486486 *
487- * @param string the error level: 'error', 'debug' or 'info'
488- * @param string the error message
487+ * @param string $level the error level: 'error', 'debug' or 'info'
488+ * @param string $message the error message
489489 * @return void
490490 */
491491 function log_message ($ level , $ message )
@@ -498,6 +498,11 @@ function log_message($level, $message)
498498 $ _log [0 ] =& load_class ('Log ' , 'core ' );
499499 }
500500
501+ // 2023-03-29: In log_message - If message not string, force string with json_encode
502+ if (!is_string ($ message )) {
503+ $ message = json_encode ($ message );
504+ }
505+
501506 $ _log [0 ]->write_log ($ level , $ message );
502507 }
503508}
@@ -509,8 +514,8 @@ function log_message($level, $message)
509514 /**
510515 * Set HTTP Status Header
511516 *
512- * @param int the status code
513- * @param string
517+ * @param int $code the status code
518+ * @param string $text
514519 * @return void
515520 */
516521 function set_status_header ($ code = 200 , $ text = '' )
@@ -804,8 +809,8 @@ function html_escape($var, $double_encode = TRUE)
804809 * Helper function used to convert a string, array, or object
805810 * of attributes to a string.
806811 *
807- * @param mixed string, array, object
808- * @param bool
812+ * @param mixed $attributes string, array, object
813+ * @param bool $js
809814 * @return string
810815 */
811816 function _stringify_attributes ($ attributes , $ js = FALSE )
0 commit comments