redact exception traces and abstract getTrace
authorAntoine Musso <hashar@free.fr>
Mon, 28 Oct 2013 16:56:37 +0000 (17:56 +0100)
committerOri Livneh <ori@wikimedia.org>
Fri, 1 Nov 2013 18:07:18 +0000 (11:07 -0700)
commit0ee7ea85d0a4569e2129cc565e6be82255c7aeb5
tree466fb63db25d7a7e60e51ed6801517c1b7a86826
parente61cb8218ba284d9d6e829dcf5734d051416b06c
redact exception traces and abstract getTrace

* Partially reverts I0a9e92448 (rationale:
   http://www.gossamer-threads.com/lists/wiki/wikitech/401558)
  - wfDebugLog()'d exceptions are always unredacted
  - Other backtraces are redacted by replacing all argument values with class /
    type names.
* Adds a pair of static methods to MWExceptionHandler:
  - MWExceptionHandler::getRedactedTrace
equivalent to Exception::getTrace, but replaces each argument value
in the trace with its class or type name.
  - MWExceptionHandler::getRedactedTraceAsString
    equivalent to Exception::getTraceAsString, but with argument values
likewise redacted.
* The rename of 'formatRedactedTrace' to 'getRedactedTraceAsString' is
  justified on two grounds:
  - 'formatRedactedTrace' didn't actually take a trace object (it took an
exception).
  - 'getRedactedTraceAsString' maintains the symmetry with
    Exception::getTraceAsString.

Change-Id: I3d570a6385f96a606e1af53c50faa03b9ebacd38
RELEASE-NOTES-1.22
includes/DefaultSettings.php
includes/Exception.php
tests/phpunit/includes/MWExceptionHandlerTest.php [new file with mode: 0644]