Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dokuwiki
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
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
Service Desk
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
BRIC
dokuwiki
Commits
f2ea8432
Commit
f2ea8432
authored
17 years ago
by
Andreas Gohr
Browse files
Options
Downloads
Patches
Plain Diff
CSRF SecurityToken added to the media manager
darcs-hash:20070908143307-7ad00-50730dd67239a2faaced2dfa0dee8de7c1db05e6.gz
parent
aea87c78
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
inc/media.php
+7
-2
7 additions, 2 deletions
inc/media.php
with
7 additions
and
2 deletions
inc/media.php
+
7
−
2
View file @
f2ea8432
...
...
@@ -50,6 +50,7 @@ function media_filesinuse($data,$id){
*/
function
media_metasave
(
$id
,
$auth
,
$data
){
if
(
$auth
<
AUTH_UPLOAD
)
return
false
;
if
(
!
checkSecurityToken
())
return
false
;
global
$lang
;
$src
=
mediaFN
(
$id
);
...
...
@@ -97,6 +98,7 @@ function media_metaform($id,$auth){
// output
echo
'<h1>'
.
hsc
(
noNS
(
$id
))
.
'</h1>'
.
NL
;
echo
'<form action="'
.
DOKU_BASE
.
'lib/exe/mediamanager.php" accept-charset="utf-8" method="post" class="meta">'
.
NL
;
formSecurityToken
();
foreach
(
$fields
as
$key
=>
$field
){
// get current value
$tags
=
array
(
$field
[
0
]);
...
...
@@ -147,6 +149,7 @@ function media_metaform($id,$auth){
*/
function
media_delete
(
$id
,
$auth
){
if
(
$auth
<
AUTH_DELETE
)
return
false
;
if
(
!
checkSecurityToken
())
return
false
;
global
$conf
;
global
$lang
;
...
...
@@ -181,6 +184,7 @@ function media_delete($id,$auth){
*/
function
media_upload
(
$ns
,
$auth
){
if
(
$auth
<
AUTH_UPLOAD
)
return
false
;
if
(
!
checkSecurityToken
())
return
false
;
require_once
(
DOKU_INC
.
'inc/confutils.php'
);
global
$lang
;
global
$conf
;
...
...
@@ -382,7 +386,8 @@ function media_fileactions($item,$auth){
$ask
=
addslashes
(
$lang
[
'del_confirm'
])
.
'\\n'
;
$ask
.
=
addslashes
(
$item
[
'id'
]);
echo
' <a href="'
.
DOKU_BASE
.
'lib/exe/mediamanager.php?delete='
.
rawurlencode
(
$item
[
'id'
])
.
'" '
.
echo
' <a href="'
.
DOKU_BASE
.
'lib/exe/mediamanager.php?delete='
.
rawurlencode
(
$item
[
'id'
])
.
'&sectoc='
.
getSecurityToken
()
.
'" '
.
'onclick="return confirm(\''
.
$ask
.
'\')" onkeypress="return confirm(\''
.
$ask
.
'\')">'
.
'<img src="'
.
DOKU_BASE
.
'lib/images/trash.png" alt="'
.
$lang
[
'btn_delete'
]
.
'" '
.
'title="'
.
$lang
[
'btn_delete'
]
.
'" class="btn" /></a>'
;
...
...
@@ -514,7 +519,7 @@ function media_uploadform($ns, $auth){
<fieldset>
<legend
class=
"hidden"
>
<?php
echo
$lang
[
'btn_upload'
]
?>
</legend>
<input
type=
"hidden"
name=
"ns"
value=
"
<?php
echo
hsc
(
$ns
)
?>
"
/>
<?php
formSecurityToken
();
?>
<p>
<label
for=
"upload__file"
>
<?php
echo
$lang
[
'txt_upload'
]
?>
:
</label>
<input
type=
"file"
name=
"upload"
class=
"edit"
id=
"upload__file"
/>
...
...
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