0

I was getting the following error:

Deprecated: Function eregi() is deprecated in /home/herbalhe/public_html/admin/includes/auth.inc.php

So I searched and found that I should be using preg_match() instead of eregi(). So I made the changes and now I am getting this error:

Warning: preg_match(): Unknown modifier 'p' in /home/herbalhe/public_html/admin/includes/auth.inc.php

The code on that line is:

if (preg_match(".inc.php",$HTTP_SERVER_VARS['PHP_SELF']) || 
    preg_match(".inc.php",$_SERVER['PHP_SELF'])) 

Any idea what I should now?

Rizier123
  • 58,877
  • 16
  • 101
  • 156

1 Answers1

1

It should be:

preg_match("/\.inc\.php$/i", $HTTP_SERVER_VARS['PHP_SELF'])
Mihai Matei
  • 24,166
  • 5
  • 32
  • 50
  • 1
    Thank you! That worked for me Cheers. – Anand Nadar Dec 10 '15 at 13:34
  • 1
    @AnandNadar you should accept the answer if that worked for you. http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work You also probably want the `i` modifier so the regex is case insensitive as your `eregi` was. – chris85 Dec 10 '15 at 13:58