Opened 16 months ago

Closed 16 months ago

Last modified 15 months ago

#3641 closed Bug (fixed)

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

Reported by: mmmbee Owned by:
Priority: normal Milestone: 1.12.x - Piwik 1.12.x
Component: Core Keywords:
Cc: Sensitive: no

Description

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 

Change History (6)

comment:1 Changed 16 months ago by mihui

Change

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

to

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

comment:2 Changed 16 months ago by matt (mattab)

  • Resolution set to fixed
  • Status changed from new to closed

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

comment:3 follow-up: Changed 16 months ago by JulienM (JulienMoumne)

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
);

comment:4 in reply to: ↑ 3 ; follow-up: Changed 16 months ago by mihui

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. :)

comment:5 in reply to: ↑ 4 ; follow-up: Changed 15 months ago by JulienM (JulienMoumne)

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.

comment:6 in reply to: ↑ 5 Changed 15 months ago by mihui

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.

Note: See TracTickets for help on using tickets.