Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Bug fix for preventing the error messages when import data from IIS log #3641

Closed
anonymous-piwik-user opened this Issue · 6 comments

3 participants

Anonymous Piwik user Matthieu Aubry Julien Moumné
Anonymous Piwik user

When I am using the python script to import the iis log, the error message will show up as below:

Strict Notice: Only variables should be passed by reference in D:\Web\PHP\Piwik\core\Common.php on line 105 
Anonymous Piwik user

Change

return str_replace($prefixTable, '', $table, $count = 1);

to

$count = 1;
return str_replace($prefixTable, '', $table, $count);
Matthieu Aubry
Owner

(In [7710]) Fixes #3641 Thanks for the patch mihui!

Julien Moumné
Collaborator

Should we globally stop using this form of method parameter documentation?

If yes, I suggest this form (or some variant):

return str_replace(
    $prefixTable, 
    '', 
    $table,
    1 // count
);
Anonymous Piwik user

Replying to JulienM:

Should we globally stop using this form of method parameter documentation?

If yes, I suggest this form (or some variant):

return str_replace(
    $prefixTable, 
    '', 
    $table,
    1 // count
);

Not sure, you might be right for the form, but you must put variable there. :)

Julien Moumné
Collaborator

Replying to mihui:

Not sure, you might be right for the form, but you must put variable there. :)

Have a look at the complete function code. This variable is not used elsewhere.

Anonymous Piwik user

Replying to JulienM:

Replying to mihui:

Not sure, you might be right for the form, but you must put variable there. :)

Have a look at the complete function code. This variable is not used elsewhere.

Yeah, you are right. :), just not sure why they put it there.
But you can't just put a CONST there since it is using the reference of a variable.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.