Last modified: 2009-07-16 20:00:06 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T21774, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 19774 - Successful Edit Call to wrong page
Successful Edit Call to wrong page
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Roan Kattouw
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-07-16 19:54 UTC by grant
Modified: 2009-07-16 20:00 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description grant 2009-07-16 19:54:26 UTC
I am making a successful edit call to the api page, however the page 'Wiki/api.php' is createdand/or modified upon calls to the api via a post request


some code:

def updatePage():
    now = datetime.datetime.now()

    data = [
        ('action','edit'),
        ('title','User:Gcallaghan'),
        #('pageid','97859'),
        ('section','new'),
        ('summary','test'),
        ('text',now),
        ('token',EDIT_TOKEN),
        ('format','xml'),
    ]

    query = '&'.join(map(lambda x: '%s=%s'% x,data))
    #print "EDIT_TOKEN: %s" % EDIT_TOKEN
    #print WIKI_API
    url = urllib.urlencode(data)
    print url
    req = urllib2.Request('%s?%s'%(WIKI_API,url))
    response = urllib2.urlopen(req, urllib.urlencode(data))
    print response.geturl()
    return response




getting the edit token ...
{'lastrevid': '897567', 'pageid': '97859', 'title': 'User:Gcallaghan', 'counter': '14', 'edittoken': '+\\', 'length': '13', 'touched': '2009-07-14T18:28:06Z', 'new': '', 'ns': '2'}

constructed url arguments ...
https://wiki.eng.<private domain>/wiki/api.php?action=edit&title=User%3AGcallaghan&section=new&summary=test&text=2009-07-16+12%3A53%3A26.737674&token=%2B%5C&format=xml

and the response ...
<?xml version="1.0" encoding="utf-8"?><api><edit result="Success" pageid="98255" title="Wiki/api.php" oldrevid="903116" newrevid="903118" /></api>
Comment 1 Roan Kattouw 2009-07-16 20:00:06 UTC
This sounds like some kind of creepy rewrite rule bug. Am I right that /wiki/Foo rewrites to /wiki/index.php?title=Foo ? In that case rearrange your URL structure so that the virtual path and the real path don't overlap, by keeping the virtual path at /wiki/Foo and moving the real one to e.g. /w/index.php?title=Foo .

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links