Function set_magic_quotes_runtime not found
2709 $file_buffer = $this->encodeString($file_buffer, $encoding);
2710 if ($magic_quotes) {
2711 if (version_compare(PHP_VERSION, '5.3.0', '<')) {
2712 set_magic_quotes_runtime($magic_quotes);2713 } else {
2714 ini_set('magic_quotes_runtime', $magic_quotes);
2715 }
Function set_magic_quotes_runtime not found
2697 $magic_quotes = get_magic_quotes_runtime();
2698 if ($magic_quotes) {
2699 if (version_compare(PHP_VERSION, '5.3.0', '<')) {
2700 set_magic_quotes_runtime(false);2701 } else {
2702 //Doesn't exist in PHP 5.4, but we don't need to check because
2703 //get_magic_quotes_runtime always returns false in 5.4+
Description
A function has been called, but not defined. This will result in a run time fatal error.
This issue can be raised for any of the following cases:
- Function is not defined.
- PHP is case-sensitive, so make sure the function case is correct.
Bad practice
class User
{
public function getName()
{
$lower = make_string_lowercase('JOHN DOE'); // function doesn't exist
return $lower;
}
}
class Utility
{
public function sanitizeText()
{
$text = htmlSpecialChars("<a href='/about'>About</a>"); // incorrect function case
return $text;
}
}
Recommended
function make_string_lowercase($str)
{
return strtolower($str);
}
class User
{
public function getName()
{
$lower = make_string_lowercase('JOHN DOE');
return $lower;
}
}
class Utility
{
public function sanitizeText()
{
$text = htmlspecialchars("<a href='/about'>About</a>");
return $text;
}
}