From cc941ed637e1e9d09f4d32cc6a06186db0ddb057 Mon Sep 17 00:00:00 2001 From: Happy-melon Date: Fri, 11 Mar 2011 23:42:53 +0000 Subject: [PATCH] add __toString() call for User objects, returning User->getName(). Now that we require PHP 5.2+, we can do this with all our major classes... :D --- includes/User.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/User.php b/includes/User.php index 111ed3ab2a..5418a0d3f2 100644 --- a/includes/User.php +++ b/includes/User.php @@ -203,6 +203,10 @@ class User { $this->clearInstanceCache( 'defaults' ); } + function __toString(){ + return $this->getName(); + } + /** * Load the user table data for this object from the source given by mFrom. */ -- 2.20.1