Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#1393 closed Bug (fixed)

sendHttpRequest() erroneously returning "1"

Reported by: vipsoft Owned by:
Priority: critical Milestone: Piwik 0.6.3
Component: Core Keywords:
Cc: Sensitive: no

Description

Three forum posters and one email to hello@… all reporting that the Piwik dashboard now says the current version available for download is "1".

Change History (11)

comment:1 Changed 4 years ago by vipsoft (robocoder)

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

(In [2239]) fixes #1393 - see http://bugs.php.net/39034; we now check for boolean true and set the response to an empty string to avoid the cast, i.e., (string)true == "1"

comment:2 Changed 4 years ago by vipsoft (robocoder)

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:3 Changed 4 years ago by vipsoft (robocoder)

According to man page for curl_setopt_array(), it'll return false immediately (ignoring future options) if it encounters an option that it can't set (from the options array parameter).

comment:4 Changed 4 years ago by vipsoft (robocoder)

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

(In [2242]) fixes #1393 - we now setopt() CURLOPT_FILE or CURLOPT_RETURNTRANSFER separately in case curl_setopt_array() failed early; we also wrap ob_start() ... ob_end_clean() around curl_exec() to protect against output leaking to browser for some other reason

comment:5 Changed 4 years ago by vipsoft (robocoder)

(In [2243]) refs #1393 - I dug deeper into the libcurl source and change history, and as a result, I'm reordering the curl options based on level of support in libcurl, i.e., oldest to latest version, increasing the likelihood that all settable options are set; added some comments

comment:6 Changed 4 years ago by vipsoft (robocoder)

(In [2244]) refs #1393 - and this is based on a review of ext/curl; the workaround (not yet implemented) is to parse the Location: headers manually

comment:7 Changed 4 years ago by matt (mattab)

Anthon, can you confirm you tested the code when a new release is published and that it displays the version number properly + downloads the files? thanks

comment:9 Changed 4 years ago by jpfle

I updated Piwik to version 0.6.4, and I still have this bug. In the top and to the right of the screen, it's written:

New Update: Piwik 1

and if I move the cursor over:

Piwik 1 est maintenant disponible.
Merci de mettre à jour! (voir les modifications).

comment:10 follow-up: Changed 4 years ago by vipsoft (robocoder)

jpfle: this was fixed in 0.6.3; if you upgraded from an earlier version, then you'll have to wait up to 8 hrs for your site to re-ping our server.

You can reset it manually, e.g.,

UPDATE piwik_option SET option_value='0' WHERE option_name='UpdateCheck_LastTimeChecked';

Then refresh your dashboard.

If that doesn't work, then send me an email (anthon at piwik.org) with your phpinfo().

comment:11 in reply to: ↑ 10 Changed 4 years ago by jpfle

Replying to vipsoft:

jpfle: this was fixed in 0.6.3; if you upgraded from an earlier version, then you'll have to wait up to 8 hrs for your site to re-ping our server.

You can reset it manually, e.g.,

UPDATE piwik_option SET option_value='0' WHERE option_name='UpdateCheck_LastTimeChecked';

Then refresh your dashboard.

You're right. That was the problem. Thanks a lot.

Note: See TracTickets for help on using tickets.