← Back to team overview

mahara-contributors team mailing list archive

[Bug 1605127] Re: Mismatched function declaration, urdate_url() in lib/activity.php

 

Hi Howard,

You are correct. The abstract "Activity" class defines update_url() with
no parameters, but then calls it with one parameter a few lines later.

The excess parameter itself actually doesn't cause any problems. If
you're calling $this->update_url($something) on an Activity subclass
that doesn't override update_url(), then PHP will silently accept it and
assume you're doing a variable-length argument list (
http://php.net/manual/en/functions.arguments.php#functions.variable-arg-
list ). In PHP 5.5 it won't even print an E_STRICT warning or anything.
In PHP 5.6 and up, it might, since they've added the "..." syntax to
explicitly indicate a variable-length argument list.

The bigger problem here is the mismatch in the signature of the
update_url() method between Activity and its subclasses. That will throw
an E_STRICT warning in PHP 5, but it's a fatal error in PHP 7.

-- 
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/1605127

Title:
  Mismatched function declaration, urdate_url() in lib/activity.php

Status in Mahara:
  In Progress
Status in Mahara 15.04 series:
  In Progress
Status in Mahara 15.10 series:
  In Progress
Status in Mahara 16.04 series:
  In Progress
Status in Mahara 16.10 series:
  In Progress

Bug description:
  Branch 16.04

  In lib/activity.php at approx line 710 the function update_url() is
  declared. It has no parameters.

  However, at approx line 750 it is called and a parameter
  ($userdata->internalid) is used. One of them must be wrong, surely?

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


References