On 2/5/07, aaron(a)svn.wikimedia.org <aaron(a)svn.wikimedia.org> wrote:
Revision: 19797
Author: aaron
Date: 2007-02-05 15:26:26 -0800 (Mon, 05 Feb 2007)
. . .
+ /**
+ * Fetch revision text if it's available to THIS user
+ * @return string
+ */
+ function revText() {
+ if( !$this->userCan( self::DELETED_TEXT ) ) {
+ return "";
+ } else {
+ return $this->getRawText();
+ }
+ }
1) You should try to mark any new functions or variables as private,
public, or protected as appropriate. This was probably intended to be
public.
2) As a more general comment, userCan should probably be deprecated in
favor of a method that works for non-current users too. Globals
should be avoided where possible, at the very least in lower-level
functions.