Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
c80dd82f
Commit
c80dd82f
authored
9 years ago
by
Roeland Jago Douma
Browse files
Options
Downloads
Patches
Plain Diff
Added mimetype repair step
* Version number increased
parent
57ceee13
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/repair/repairmimetypes.php
+52
-0
52 additions, 0 deletions
lib/repair/repairmimetypes.php
tests/lib/repair/repairmimetypes.php
+72
-0
72 additions, 0 deletions
tests/lib/repair/repairmimetypes.php
version.php
+1
-1
1 addition, 1 deletion
version.php
with
125 additions
and
1 deletion
lib/repair/repairmimetypes.php
+
52
−
0
View file @
c80dd82f
...
...
@@ -250,6 +250,39 @@ class RepairMimeTypes extends BasicEmitter implements \OC\RepairStep {
self
::
updateMimetypes
(
$updatedMimetypes
);
}
private
function
introduceJavaMimeType
()
{
$updatedMimetypes
=
array
(
'class'
=>
'application/java'
,
'java'
=>
'text/x-java-source'
,
);
self
::
updateMimetypes
(
$updatedMimetypes
);
}
private
function
introduceHppMimeType
()
{
$updatedMimetypes
=
array
(
'hpp'
=>
'text/x-h'
,
);
self
::
updateMimetypes
(
$updatedMimetypes
);
}
private
function
introduceRssMimeType
()
{
$updatedMimetypes
=
array
(
'rss'
=>
'application/rss+xml'
,
);
self
::
updateMimetypes
(
$updatedMimetypes
);
}
private
function
introduceRtfMimeType
()
{
$updatedMimetypes
=
array
(
'rtf'
=>
'text/rtf'
,
);
self
::
updateMimetypes
(
$updatedMimetypes
);
}
/**
* Fix mime types
*/
...
...
@@ -294,5 +327,24 @@ class RepairMimeTypes extends BasicEmitter implements \OC\RepairStep {
$this
->
emit
(
'\OC\Repair'
,
'info'
,
array
(
'Fixed Yaml/Yml mime types'
));
}
}
// Mimetype updates from #19272
if
(
version_compare
(
$ocVersionFromBeforeUpdate
,
'8.2.0.8'
,
'<'
))
{
if
(
$this
->
introduceJavaMimeType
())
{
$this
->
emit
(
'\OC\Repair'
,
'info'
,
array
(
'Fixed java/class mime types'
));
}
if
(
$this
->
introduceHppMimeType
())
{
$this
->
emit
(
'\OC\Repair'
,
'info'
,
array
(
'Fixed hpp mime type'
));
}
if
(
$this
->
introduceRssMimeType
())
{
$this
->
emit
(
'\OC\Repair'
,
'info'
,
array
(
'Fixed rss mime type'
));
}
if
(
$this
->
introduceRtfMimeType
())
{
$this
->
emit
(
'\OC\Repair'
,
'info'
,
array
(
'Fixed rtf mime type'
));
}
}
}
}
This diff is collapsed.
Click to expand it.
tests/lib/repair/repairmimetypes.php
+
72
−
0
View file @
c80dd82f
...
...
@@ -282,6 +282,68 @@ class RepairMimeTypes extends \Test\TestCase {
$this
->
renameMimeTypes
(
$currentMimeTypes
,
$fixedMimeTypes
);
}
/**
* Test renaming the java mime types
*/
public
function
testRenameJavaMimeType
()
{
$currentMimeTypes
=
[
[
'test.java'
,
'application/octet-stream'
],
[
'test.class'
,
'application/octet-stream'
],
];
$fixedMimeTypes
=
[
[
'test.java'
,
'text/x-java-source'
],
[
'test.class'
,
'application/java'
],
];
$this
->
renameMimeTypes
(
$currentMimeTypes
,
$fixedMimeTypes
);
}
/**
* Test renaming the hpp mime type
*/
public
function
testRenameHppMimeType
()
{
$currentMimeTypes
=
[
[
'test.hpp'
,
'application/octet-stream'
],
];
$fixedMimeTypes
=
[
[
'test.hpp'
,
'text/x-h'
],
];
$this
->
renameMimeTypes
(
$currentMimeTypes
,
$fixedMimeTypes
);
}
/**
* Test renaming the rss mime type
*/
public
function
testRenameRssMimeType
()
{
$currentMimeTypes
=
[
[
'test.rss'
,
'application/octet-stream'
],
];
$fixedMimeTypes
=
[
[
'test.rss'
,
'application/rss+xml'
],
];
$this
->
renameMimeTypes
(
$currentMimeTypes
,
$fixedMimeTypes
);
}
/**
* Test renaming the hpp mime type
*/
public
function
testRenameRtfMimeType
()
{
$currentMimeTypes
=
[
[
'test.rtf'
,
'application/octet-stream'
],
];
$fixedMimeTypes
=
[
[
'test.rtf'
,
'text/rtf'
],
];
$this
->
renameMimeTypes
(
$currentMimeTypes
,
$fixedMimeTypes
);
}
/**
* Test renaming and splitting old office mime types when
* new ones already exist
...
...
@@ -399,6 +461,11 @@ class RepairMimeTypes extends \Test\TestCase {
[
'test.cnf'
,
'text/plain'
],
[
'test.yaml'
,
'application/yaml'
],
[
'test.yml'
,
'application/yaml'
],
[
'test.java'
,
'text/x-java-source'
],
[
'test.class'
,
'application/java'
],
[
'test.hpp'
,
'text/x-h'
],
[
'test.rss'
,
'application/rss+xml'
],
[
'test.rtf'
,
'text/rtf'
],
];
$fixedMimeTypes
=
[
...
...
@@ -438,6 +505,11 @@ class RepairMimeTypes extends \Test\TestCase {
[
'test.cnf'
,
'text/plain'
],
[
'test.yaml'
,
'application/yaml'
],
[
'test.yml'
,
'application/yaml'
],
[
'test.java'
,
'text/x-java-source'
],
[
'test.class'
,
'application/java'
],
[
'test.hpp'
,
'text/x-h'
],
[
'test.rss'
,
'application/rss+xml'
],
[
'test.rtf'
,
'text/rtf'
],
];
$this
->
renameMimeTypes
(
$currentMimeTypes
,
$fixedMimeTypes
);
...
...
This diff is collapsed.
Click to expand it.
version.php
+
1
−
1
View file @
c80dd82f
...
...
@@ -23,7 +23,7 @@
// We only can count up. The 4. digit is only for the internal patchlevel to trigger DB upgrades
// between betas, final and RCs. This is _not_ the public version number. Reset minor/patchlevel
// when updating major/minor version number.
$OC_Version
=
array
(
8
,
2
,
0
,
7
);
$OC_Version
=
array
(
8
,
2
,
0
,
8
);
// The human readable string
$OC_VersionString
=
'8.2 beta1'
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment