File tree Expand file tree Collapse file tree 4 files changed +36
-2
lines changed Expand file tree Collapse file tree 4 files changed +36
-2
lines changed Original file line number Diff line number Diff line change @@ -461,7 +461,12 @@ sub download_mw_mediafile {
461
461
462
462
my $response = $mediawiki -> {ua }-> get($download_url );
463
463
if ($response -> code == HTTP_CODE_OK) {
464
- return $response -> decoded_content;
464
+ # It is tempting to return
465
+ # $response->decoded_content({charset => "none"}), but
466
+ # when doing so, utf8::downgrade($content) fails with
467
+ # "Wide character in subroutine entry".
468
+ $response -> decode();
469
+ return $response -> content();
465
470
} else {
466
471
print {*STDERR } " Error downloading mediafile from :\n " ;
467
472
print {*STDERR } " URL: ${download_url} \n " ;
Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ usage () {
20
20
echo " install | -i : Install a wiki on your computer."
21
21
echo " delete | -d : Delete the wiki and all its pages and "
22
22
echo " content."
23
+ echo " start | -s : Start the previously configured lighttpd daemon"
24
+ echo " stop : Stop lighttpd daemon."
23
25
}
24
26
25
27
@@ -33,6 +35,14 @@ case "$1" in
33
35
wiki_delete
34
36
exit 0
35
37
;;
38
+ " start" | " -s" )
39
+ start_lighttpd
40
+ exit
41
+ ;;
42
+ " stop" )
43
+ stop_lighttpd
44
+ exit
45
+ ;;
36
46
" --help" | " -h" )
37
47
usage
38
48
exit 0
Original file line number Diff line number Diff line change @@ -58,6 +58,25 @@ test_expect_success 'git clone works on previously created wiki with media files
58
58
test_cmp mw_dir_clone/Foo.txt mw_dir/Foo.txt
59
59
'
60
60
61
+ test_expect_success ' git push can upload media (File:) files containing valid UTF-8' '
62
+ wiki_reset &&
63
+ git clone mediawiki::' " $WIKI_URL " ' mw_dir &&
64
+ (
65
+ cd mw_dir &&
66
+ "$PERL_PATH" -e "print STDOUT \"UTF-8 content: éèàéê€.\";" >Bar.txt &&
67
+ git add Bar.txt &&
68
+ git commit -m "add a text file with UTF-8 content" &&
69
+ git push
70
+ )
71
+ '
72
+
73
+ test_expect_success ' git clone works on previously created wiki with media files containing valid UTF-8' '
74
+ test_when_finished "rm -rf mw_dir mw_dir_clone" &&
75
+ git clone -c remote.origin.mediaimport=true \
76
+ mediawiki::' " $WIKI_URL " ' mw_dir_clone &&
77
+ test_cmp mw_dir_clone/Bar.txt mw_dir/Bar.txt
78
+ '
79
+
61
80
test_expect_success ' git push & pull work with locally renamed media files' '
62
81
wiki_reset &&
63
82
git clone mediawiki::' " $WIKI_URL " ' mw_dir &&
Original file line number Diff line number Diff line change @@ -289,7 +289,6 @@ start_lighttpd () {
289
289
# Kill daemon lighttpd and removes files and folders associated.
290
290
stop_lighttpd () {
291
291
test -f " $WEB_TMP /pid" && kill $( cat " $WEB_TMP /pid" )
292
- rm -rf " $WEB "
293
292
}
294
293
295
294
# Create the SQLite database of the MediaWiki. If the database file already
@@ -415,6 +414,7 @@ wiki_reset () {
415
414
wiki_delete () {
416
415
if test $LIGHTTPD = " true" ; then
417
416
stop_lighttpd
417
+ rm -fr " $WEB "
418
418
else
419
419
# Delete the wiki's directory.
420
420
rm -rf " $WIKI_DIR_INST /$WIKI_DIR_NAME " ||
You can’t perform that action at this time.
0 commit comments