0

The plugin that is getting errors is WP Download Manager

Error:

Strict Standards: Only variables should be passed by reference in /home/otbm/public_html/wp-content/plugins/download-manager/functions.php on line 1879

Line 1879:

if(count($vars['files'])==1) $vars['file_ext'] = end($tmpdata = explode(".", $vars['files'][0]));

also getting this error in admin:

Strict Standards: Only variables should be passed by reference in /home/otbm/public_html/wp-content/plugins/download-manager/wpdm.php(1) : eval()'d code on line 1034

I can't find that line as it is all one single line of code.

Any help would be appreciated.

Michael Berkowski
  • 267,341
  • 46
  • 444
  • 390
  • Because [in 5.4, the `E_STRICT` error level became part of `E_ALL`](http://www.php.net/manual/en/function.error-reporting.php). You can still disable it as documented, if you are not in a position to correct the strict standards violations in WP plugins. – Michael Berkowski Feb 14 '14 at 18:37
  • 1
    Line 1879 is in error because it passes the result of `explode()` into `end()`. Instead, since it is stored to `$tmpdata`, you should do `end($tmpdata)` in _another statement_ rather than packing it all into one line. – Michael Berkowski Feb 14 '14 at 18:40
  • Really though, you should petition the maintainer of that WP plugin to correct it upstream. WP is notoriously bad for coding standards & suppressed or ignored warnings, unfortunately. – Michael Berkowski Feb 14 '14 at 18:41
  • @MichaelBerkowski - Thanks for your help. I am a front end developer and don't know my php real well. :) How would I separate it into another statement? – Von Scott Feb 14 '14 at 18:52
  • Something like `$tmpdata = explode(".", $vars['files'][0]); if(count($vars['files'])==1) $vars['file_ext'] = end($tmpdata);` Should do it. The `explode()` first, followed by the `if()`. – Michael Berkowski Feb 14 '14 at 18:56

0 Answers0