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
96946cc9
Commit
96946cc9
authored
13 years ago
by
Dominik Eckelmann
Browse files
Options
Downloads
Patches
Plain Diff
replaced $HTTP_RAW_POST_DATA with http_get_raw_post_data function
parent
c2eb026d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
inc/IXR_Library.php
+4
-3
4 additions, 3 deletions
inc/IXR_Library.php
inc/httputils.php
+8
-0
8 additions, 0 deletions
inc/httputils.php
lib/exe/xmlrpc.php
+0
-3
0 additions, 3 deletions
lib/exe/xmlrpc.php
lib/plugins/acl/ajax.php
+6
-5
6 additions, 5 deletions
lib/plugins/acl/ajax.php
with
18 additions
and
11 deletions
inc/IXR_Library.php
+
4
−
3
View file @
96946cc9
...
...
@@ -302,11 +302,12 @@ class IXR_Server {
}
function
serve
(
$data
=
false
)
{
if
(
!
$data
)
{
global
$HTTP_RAW_POST_DATA
;
if
(
!
$HTTP_RAW_POST_DATA
)
{
$postData
=
trim
(
http_get_raw_post_data
());
if
(
!
$postData
)
{
die
(
'XML-RPC server accepts POST requests only.'
);
}
$data
=
$
HTTP_RAW_POST_DATA
;
$data
=
$
postData
;
}
$this
->
message
=
new
IXR_Message
(
$data
);
if
(
!
$this
->
message
->
parse
())
{
...
...
This diff is collapsed.
Click to expand it.
inc/httputils.php
+
8
−
0
View file @
96946cc9
...
...
@@ -249,3 +249,11 @@ function http_cached_finish($file, $content) {
print
$content
;
}
}
function
http_get_raw_post_data
()
{
static
$postData
=
null
;
if
(
$postData
===
null
)
{
$postData
=
file_get_contents
(
'php://input'
);
}
return
$postData
;
}
This diff is collapsed.
Click to expand it.
lib/exe/xmlrpc.php
+
0
−
3
View file @
96946cc9
<?php
if
(
!
defined
(
'DOKU_INC'
))
define
(
'DOKU_INC'
,
dirname
(
__FILE__
)
.
'/../../'
);
// fix when '< ?xml' isn't on the very first line
if
(
isset
(
$HTTP_RAW_POST_DATA
))
$HTTP_RAW_POST_DATA
=
trim
(
$HTTP_RAW_POST_DATA
);
require_once
(
DOKU_INC
.
'inc/init.php'
);
require_once
(
DOKU_INC
.
'inc/remote.php'
);
session_write_close
();
//close session
...
...
This diff is collapsed.
Click to expand it.
lib/plugins/acl/ajax.php
+
6
−
5
View file @
96946cc9
...
...
@@ -6,16 +6,17 @@
* @author Andreas Gohr <andi@splitbrain.org>
*/
//fix for Opera XMLHttpRequests
if
(
!
count
(
$_POST
)
&&
!
empty
(
$HTTP_RAW_POST_DATA
)){
parse_str
(
$HTTP_RAW_POST_DATA
,
$_POST
);
}
if
(
!
defined
(
'DOKU_INC'
))
define
(
'DOKU_INC'
,
dirname
(
__FILE__
)
.
'/../../../'
);
require_once
(
DOKU_INC
.
'inc/init.php'
);
//close session
session_write_close
();
//fix for Opera XMLHttpRequests
$postData
=
http_get_raw_post_data
();
if
(
!
count
(
$_POST
)
&&
!
empty
(
$postData
)){
parse_str
(
$postData
,
$_POST
);
}
if
(
!
auth_isadmin
())
die
(
'for admins only'
);
if
(
!
checkSecurityToken
())
die
(
'CRSF Attack'
);
...
...
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