Reviewed:  https://reviews.mahara.org/10578
Committed: 
https://git.mahara.org/mahara/mahara/commit/6a035b64e1145419aa32c42a14678e5f19755245
Submitter: Cecilia Vela Gurovic ([email protected])
Branch:    master

commit 6a035b64e1145419aa32c42a14678e5f19755245
Author: Mitsuhiro Yoshida <[email protected]>
Date:   Fri Nov 8 03:36:27 2019 +0900

Bug 1851699: Adding a condition to cron.php for PHP FastCGI environment.

Change-Id: Iee07ce7bb7c8602c23c5af78c3761d6dffd855bd

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask 
on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1851699

Title:
  cron.php with '$cfg->urlsecret' dosen't work on cronjob under PHP
  FastCGI enviroment.

Status in Mahara:
  Fix Committed

Bug description:
  When we set $cfg->urlsecret on config.php, cron.php doesn't work on
  cronjob under PHP FastCGI environment.

  So we need to add one more condition to cron.php as below.

  File to modify:
  lib/cron.php

  Line:
  40

  [before]
  if (php_sapi_name() != 'cli' && get_config('urlsecret') !== null) {
      $urlsecret = param_alphanumext('urlsecret', -1);
      if ($urlsecret !== get_config('urlsecret')) {
          die_info(get_string('accessdeniednourlsecret', 'error'));
      }
  }

  [after]
  if (php_sapi_name() != 'cli' && substr(php_sapi_name(), 0, 3) !== 'cgi' && 
get_config('urlsecret') !== null) {
      $urlsecret = param_alphanumext('urlsecret', -1);
      if ($urlsecret !== get_config('urlsecret')) {
          die_info(get_string('accessdeniednourlsecret', 'error'));
      }
  }

  Ref:
  [PHP: php_sapi_name - Manual]
  https://www.php.net/manual/en/function.php-sapi-name.php

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1851699/+subscriptions

_______________________________________________
Mailing list: https://launchpad.net/~mahara-contributors
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~mahara-contributors
More help   : https://help.launchpad.net/ListHelp

Reply via email to