-2

I have a site running on Expression Engine. It appears the webserver was upgraded and now a plugin is throwing an error message. It doesn't seem to be impacting the operation of the site so while I try and remedy the issue I thought I could hide the PHP error message with jquery.

The error message is being put on the page before anything else -> before the DOCTYPE tag.

Here's one line:

Strict Standards: Non-static method Foxee_utils::check_cache() should not be called statically, assuming $this from incompatible context in /home/noelwhit/public_html/admin/modules/foxee/mod.foxee.php on line 228

I was toying with $(document).before() in some way but appear to be a little bit away from greatness just yet.

Thanks.

$(document).before()
Adam Fletcher
  • 1,021
  • 1
  • 10
  • 18
  • 12
    I'm sorry, I can't stop laughing at this question title. – Mulan Oct 31 '13 at 01:07
  • And you want to do this instead of fix the problem.. why? – CrayonViolent Oct 31 '13 at 01:08
  • are only EE super-admins seeing the message? if so why bother? – AllInOne Oct 31 '13 at 01:08
  • 1
    Literally laughed so hard I almost peed. – Mulan Oct 31 '13 at 01:09
  • 3
    looks like XY problem :) actually plugin should be fixed, if it is impossible error should be hidden at php side via php.ini or error_reporting, jquery of course can help to hide part of html, but it is so bad solution, I dont want to provide it – Iłya Bursov Oct 31 '13 at 01:13
  • possible duplicate of [PHP 5 disable strict standards error](http://stackoverflow.com/questions/1248952/php-5-disable-strict-standards-error) – sanmai Oct 31 '13 at 01:17

2 Answers2

3

This definitely shouldn't be fixed with jQuery. There are at least two ways to fix the problem with other than jQuery:

  1. The hard and proper way. Prefix Foxee_utils::check_cache() with static keyword:

    static function check_cache(/* skip */)
    
  2. The easy way. Add somewhere in the site configuration files, after other call to error_reporting() if there is one:

    error_reporting(error_reporting() & ~E_STRICT);
    
sanmai
  • 29,083
  • 12
  • 64
  • 76
1

That's a duplicate of many questions. But here's your answer

error_reporting(0)

At the top of your page


EDIT: I will strongly advise to not use this answer but if you really want to hack your way... use this answer to help you. Basically you take your inner html, then rewrite your page. But you should sincerely try to solve your problem instead of hiding it... The community is here to help you, make good use of it.

Here's a snippet of his answer :

var markup= document.documentElement.innerHTML;
markup= '<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">'+markup+'</html>';
document.open();
document.write(markup);
document.close();
Community
  • 1
  • 1
Michael Villeneuve
  • 3,933
  • 4
  • 26
  • 40