What is the problem?
If using API Parse anonymously[1] on a wiki with IP Masking enabled, signatures (~~~~) are rendered as the user's current IP address.
(Example from Reply tools on https://de.wikipedia.beta.wmflabs.org)
This is not an accurate representation of how the page will actually look when it is saved. When the edit is saved a new temporary user will be generated and the signature will be that of the new temporary user.
When using the default preview in Wikitext editor (the "Show preview" button), signatures are rendered as temporary account names. I don't know how it does this.
(Example from default preview on https://de.wikipedia.beta.wmflabs.org)
The list of things this affects includes Reply tools, Real-Time Preview and Live Preview.
Steps to reproduce problem
- Go to https://de.wikipedia.beta.wmflabs.org/wiki/Benutzer_Diskussion:*Unregistered_3497
- Make sure you are not logged in nor have a temporary account (which will be displayed in the top right. You may need to clear your cookies.)
- Click the button Eine Diskussion beginnen
- In the textarea, type ~~~~
Expected behavior: It is replaced by a string of the form *Unregistered 1234 11:43, 7. Mär. 2023 (CET)
Observed behavior: It is replaced by <ip address> 11:43, 7. Mär. 2023 (CET)
Alternatively, if you have curl you could run this in the command line:
curl 'https://de.wikipedia.beta.wmflabs.org/w/api.php' -X POST -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' --data-raw 'action=parse&format=json&formatversion=2&text=%3Cspan%3E~~~~%3C%2Fspan%3E&contentmodel=wikitext&prop=text&onlypst=true'
and you will get something like this back:
{"parse":{"text":"<span>[[Spezial:Beiträge/<ip address>|<ip address>]] 11:47, 7. Mär. 2023 (CET)</span>"}}
This should be:
{"parse":{"text":"<span>[[Spezial:Beiträge/*Unregistered 1234|*Unregistered 1234]] 11:47, 7. Mär. 2023 (CET)</span>"}}
Environment
Wiki(s): https://de.wikipedia.beta.wmflabs.org MediaWiki 1.40.0-alpha (f139afe) 08:20, 7 March 2023.
Notes
- "Anonymously" meaning you are neither logged in as a named user nor have a temporary account. You may need to clear your cookies before testing.