Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PluginMarket
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Stud.IP
Plugins
PluginMarket
Commits
b9d112a4
Commit
b9d112a4
authored
10 years ago
by
Jan-Hendrik Willms
Browse files
Options
Downloads
Patches
Plain Diff
fix mime type again (controller sets invalid mime type, this needs to be overwritten), re
#1
parent
5e35524d
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
classes/MarketImage.class.php
+1
-1
1 addition, 1 deletion
classes/MarketImage.class.php
controllers/myplugins.php
+1
-1
1 addition, 1 deletion
controllers/myplugins.php
controllers/presenting.php
+3
-0
3 additions, 0 deletions
controllers/presenting.php
with
5 additions
and
2 deletions
classes/MarketImage.class.php
+
1
−
1
View file @
b9d112a4
...
@@ -45,7 +45,7 @@ class MarketImage extends SimpleORMap {
...
@@ -45,7 +45,7 @@ class MarketImage extends SimpleORMap {
public
function
outputImage
()
{
public
function
outputImage
()
{
$path
=
self
::
getImageDataPath
()
.
"/"
.
$this
->
getId
();
$path
=
self
::
getImageDataPath
()
.
"/"
.
$this
->
getId
();
header
(
"Content-Type: "
.
mime_content_type
(
$path
)
);
header
(
"Content-Type: "
.
$this
[
'mimetype'
]
);
header
(
"Content-Disposition: inline; filename="
.
$this
[
'filename'
]);
header
(
"Content-Disposition: inline; filename="
.
$this
[
'filename'
]);
echo
file_get_contents
(
$path
);
echo
file_get_contents
(
$path
);
}
}
...
...
This diff is collapsed.
Click to expand it.
controllers/myplugins.php
+
1
−
1
View file @
b9d112a4
...
@@ -112,7 +112,7 @@ class MypluginsController extends PluginController {
...
@@ -112,7 +112,7 @@ class MypluginsController extends PluginController {
$file
=
new
MarketImage
();
$file
=
new
MarketImage
();
$file
[
'plugin_id'
]
=
$this
->
marketplugin
->
getId
();
$file
[
'plugin_id'
]
=
$this
->
marketplugin
->
getId
();
$file
[
'filename'
]
=
$name
;
$file
[
'filename'
]
=
$name
;
$file
[
'mimetype'
]
=
$files
[
't
yp
e'
][
$index
];
$file
[
'mimetype'
]
=
mime_content_type
(
$files
[
't
mp_nam
e'
][
$index
]
)
;
$file
[
'position'
]
=
$position
;
$file
[
'position'
]
=
$position
;
$file
->
installFromPath
(
$files
[
'tmp_name'
][
$index
]);
$file
->
installFromPath
(
$files
[
'tmp_name'
][
$index
]);
$file
->
store
();
$file
->
store
();
...
...
This diff is collapsed.
Click to expand it.
controllers/presenting.php
+
3
−
0
View file @
b9d112a4
...
@@ -155,7 +155,10 @@ class PresentingController extends PluginController {
...
@@ -155,7 +155,10 @@ class PresentingController extends PluginController {
public
function
image_action
(
$image_id
)
{
public
function
image_action
(
$image_id
)
{
$this
->
image
=
new
MarketImage
(
$image_id
);
$this
->
image
=
new
MarketImage
(
$image_id
);
$this
->
set_content_type
(
$this
->
image
[
'mimetype'
]);
$this
->
image
->
outputImage
();
$this
->
image
->
outputImage
();
$this
->
render_nothing
();
$this
->
render_nothing
();
}
}
...
...
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