Comments (5)
Are you using the Latest commit (f096e19 on Jul 6, 2014)?
We initially had an issue with our wiki on upgrading to 1.27.1. The only change I can see in our User.php is this:
Zeus:Downloads jeremy$ diff -u original/includes/user/User.php modified/includes/user/User.php
--- original/includes/user/User.php 2016-08-22 13:53:01.000000000 -0700
+++ modified/includes/user/User.php 2016-09-28 17:22:28.000000000 -0700
@@ -3744,7 +3744,7 @@
} elseif ( !$session->getUser()->equals( $this ) ) {
\MediaWiki\Logger\LoggerFactory::getInstance( 'session' )
->warning( __METHOD__ .
- ": Cannot log user \"$this\" out of a user \"{$session->getUser()}\"'s session"
+ ": Cannot log user \"this\" out of a user \"{$session->getUser()}\"'s session"
);
// But we still may as well make this user object anon
$this->clearInstanceCache( 'defaults' );
Most likely this to me seems like a bug as they shouldn't be using $this since its a special reference to the current object. I hadn't debugged anymore at the time.
from smf-mw-auth.
Actually looking at it more, it seems that the ip function isn't returning a string for some reason.
When you use $this in a string, it gets handled by the magic function __toString().
/**
* @return string
*/
public function __toString() {
return $this->getName();
}
Which of course is handled by getName.
/**
* Get the user name, or the IP of an anonymous user
* @return string User's name or IP address
*/
public function getName() {
if ( $this->isItemLoaded( 'name', 'only' ) ) {
// Special case optimisation
return $this->mName;
} else {
$this->load();
if ( $this->mName === false ) {
// Clean up IPs
$this->mName = IP::sanitizeIP( $this->getRequest()->getIP() );
}
return $this->mName;
}
}
As it is a guest, it should return their IP
However the IP function has 2 places where a non string could be returned
public static function sanitizeIP( $ip ) {
$ip = trim( $ip );
if ( $ip === '' ) {
return null;
}
if ( self::isIPv4( $ip ) || !self::isIPv6( $ip ) ) {
return $ip; // nothing else to do for IPv4 addresses or invalid ones
}
If $ip was null or if it somehow doesn't fall into a valid ipv4 or ipv6 address. Only way to test this at this point would be to see what $this->getRequest()->getIP() is returning.
from smf-mw-auth.
Just as a shot, changed my user/User.php to reflect what you guys have and it seems to have resolved the issue.
Changing line 3747 to:
": Cannot log user "this" out of a user "{$session->getUser()}"'s session"
from smf-mw-auth.
I filed https://phabricator.wikimedia.org/T148486 upstream for this.
from smf-mw-auth.
This was fixed by MediaWiki and I haven't had any additional reports on this since then. Closing for now, if it still occurs we can reinvestigate this.
from smf-mw-auth.
Related Issues (16)
- $user->setupSession(); to wfSetupSession(); HOT 2
- $wgAuth is deprecated in 1.27 HOT 5
- Error with smcFunc in latest version HOT 1
- MW login not working HOT 3
- Errors in MW 1.31.1 HOT 2
- SMF 2.1 | Mediawiki 1.35.1 HOT 5
- Login trouble with Mediwiki 1.36.1 HOT 5
- compat auth not working HOT 4
- Does not work with SMF 2.1.2 and MediaWiki 1.38.2 HOT 18
- Problem Authenticating to MW 1.40.0 from SMF 2.1.4 HOT 15
- People not being removed from Wiki groups HOT 3
- can't assign bureaucrat role anyhow HOT 3
- Cannot login? HOT 2
- 500 Internal Server Error with v1.24.0 HOT 5
- User not being logged in proper HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smf-mw-auth.