0

I am upgrading the PHP version used for a project. Used PHP Code Sniffer to find possible issues with PHP 7.2. How to resolve the following issue ?

1) $this->mbstring_overload = ini_get('mbstring.func_overload') & 2;

INI directive 'mbstring.func_overload' is deprecated since PHP 7.2.

2) $s->service($HTTP_RAW_POST_DATA);

Global variable '$HTTP_RAW_POST_DATA' is deprecated since PHP 5.6 and removed since PHP 7.0; Use php://input instead

3) $this->asp_tags = (ini_get('asp_tags') != '0'); INI directive 'asp_tags' is removed since PHP 7.0. Since this is removed in PHP 7.0, what is the alternative for this?

Shankar
  • 113
  • 1
  • 14

1 Answers1

0
1) if (function_exists('mb_strlen') && ((int)ini_get('mbstring.func_overload') & 2)){ $this->mbstring_overload = ini_get('mbstring.func_overload') & 2; }
2) $s->service(file_get_contents("php://input"));  
Alpy
  • 759
  • 6
  • 9
  • `$this->mbstring_overload = if (function_exists('mb_strlen') && ((int)ini_get('mbstring.func_overload') & 2))` Should it be like this ? – Shankar Feb 25 '19 at 12:18
  • Hi @Alpy, I have this line in my code. Can you tell me, how to fix this? `if (isset($GLOBALS['HTTP_RAW_POST_DATA']) && mb_strlen($GLOBALS['HTTP_RAW_POST_DATA']))` – Shankar Feb 26 '19 at 06:59
  • just remove the full if condition since this is deprecated and not asked by another condition – Alpy Feb 26 '19 at 07:55