CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Warning: ini_restore() disabled in VersionCheck.php->pingBack() line 301
Pages: [1]

Author Topic: Warning: ini_restore() disabled in VersionCheck.php->pingBack() line 301  (Read 5168 times)

ArthurC

  • I’m new here
  • *
  • Posts: 14
  • Karma: 0
  • CiviCRM version: 4.3.5
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.32
  • PHP version: 5.3.27
Warning: ini_restore() disabled in VersionCheck.php->pingBack() line 301
August 11, 2013, 02:36:43 pm
We're new to CiviCRM and are just testing in a test environment. On a couple of occasions logging in, this warning message has appeared:

Warning: ini_restore() has been disabled for security reasons in CRM_Utils_VersionCheck->pingBack() (line 301 of ... VersionCheck.php)

Could someone please explain what is happening in pingBack() (see below)?

What is "ini_restore('default_socket_timeout');" supposed to restore?

Would there be problems if we went into production with ini_restore() still disabled? (We can enable it in php.ini, but I'm curious)

Thanks, Arthur

  private function pingBack() {
    ini_set('default_socket_timeout', self::CHECK_TIMEOUT);
    $params = array(
      'http' => array(
        'method' => 'POST',
        'header' => 'Content-type: application/x-www-form-urlencoded',
        'content' => http_build_query($this->stats),
      ),
    );
    $ctx = stream_context_create($params);
    $this->latestVersion = @file_get_contents(self::LATEST_VERSION_AT, FALSE, $ctx);
    if (!preg_match('/^\d+\.\d+\.\d+$/', $this->latestVersion)) {
      $this->latestVersion = NULL;
    }
    else {
      $this->latestVersion = trim($this->latestVersion);
    }
    ini_restore('default_socket_timeout');
  }


« Last Edit: August 11, 2013, 02:40:46 pm by ArthurC »

Wes Reimer

  • I post occasionally
  • **
  • Posts: 49
  • Karma: 1
  • CiviCRM version: 4.4.6
  • CMS version: WordPress 3.9.x
  • MySQL version: 5.5.36-cll
  • PHP version: 5.3.27
Re: Warning: ini_restore() disabled in VersionCheck.php->pingBack() line 301
May 06, 2014, 01:31:34 pm
I would also like this question answered. This is happening for me on a brand new install of Civi 4.4.5 on WordPress 3.9.

I also get these:

Warning: Cannot modify header information - headers already sent by (output started at [...]/public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/VersionCheck.php:301) in [...]/public_html/wp-includes/option.php on line 747

Warning: Cannot modify header information - headers already sent by (output started at [...]/public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/VersionCheck.php:301) in [...]/public_html/wp-includes/option.php on line 748

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Warning: ini_restore() disabled in VersionCheck.php->pingBack() line 301

This forum was archived on 2017-11-26.