https://bugzilla.wikimedia.org/show_bug.cgi?id=18022

           Summary: Special:Import now eating all ampersands
           Product: MediaWiki
           Version: 1.15-svn
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: blocker
          Priority: Normal
         Component: Export/Import
        AssignedTo: [email protected]
        ReportedBy: [email protected]


Special:Import will eat all ampersands!
Do not use Special:Import unless you want your imports damaged.
Same problem for importDump.php.
Your file will not make the round trip Special:Export ->
Special:Import unscathed! importTextFile.php is safe though.

Proof:
Make a page called [[Test]] whose wikitext is:
1&2&[http://x.y/bla?o&p=q&r=s&v=t ooo]
Then run this shell script:
site=http://my.example.com
POST "$site/index.php?title=Special:Export&action=submit" <<EOF|tee 1.xml|sed
s/Test/Test2/ > 2.xml
catname=&nsindex=0&pages=Test&curonly=1&wpDownload=1
EOF
diff -U0 [12].xml
#Then import 2.xml via Special:Import or importDump.php. Then
for i in '' 2
do GET "$site/index.php?title=Test$i&action=raw"; echo
done

You will see:
-    <title>Test</title>
+    <title>Test2</title>
1&2&amp;[http://x.y/bla?o&p=q&r=s&amp;v=t ooo]
12amp;[http://x.y/bla?op=qr=samp;v=t ooo]

The last line is the mangled result.
Tested on a wiki with $wgLanguageCode='zh-tw'. Probably affects en too.


-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to