diff --git a/comment.php b/comment.php
index 9c324b34..6ec972c8 100644
--- a/comment.php
+++ b/comment.php
@@ -8,6 +8,7 @@ include('serendipity_config.inc.php');
include S9Y_INCLUDE_PATH . 'include/functions_entries_admin.inc.php';
header('Content-Type: text/html; charset=' . LANG_CHARSET);
+$raw_post_data = file_get_contents("php://input");
if (isset($serendipity['GET']['delete'], $serendipity['GET']['entry'], $serendipity['GET']['type']) && serendipity_checkFormToken()) {
serendipity_deleteComment($serendipity['GET']['delete'], $serendipity['GET']['entry'], $serendipity['GET']['type']);
@@ -65,14 +66,14 @@ if ($pb_logging) {
if (!($type = @$_REQUEST['type'])) {
if ($pb_logging) {
ob_start();
- print_r($HTTP_RAW_POST_DATA);
+ print_r($raw_post_data);
$tmp = ob_get_contents();
ob_end_clean();
log_pingback('NO TYPE HANDED!');
}
// WordPress pingbacks don't give any parameter. If it is a XML POST asume it's a pigback
- if ($_SERVER['CONTENT_TYPE'] == 'text/xml' && isset($HTTP_RAW_POST_DATA)) {
+ if ($_SERVER['CONTENT_TYPE'] == 'text/xml' && isset($raw_post_data)) {
$type = 'pingback';
}
else {
@@ -131,12 +132,12 @@ if ($type == 'trackback') {
log_pingback('RECEIVED PINGBACK');
# PHP 4.2.2 way of doing things
ob_start();
- print_r($HTTP_RAW_POST_DATA);
+ print_r($raw_post_data);
$tmp = ob_get_contents();
ob_end_clean();
log_pingback('HTTP_RAW_POST_DATA: ' .$tmp);
}
- if (add_pingback($_REQUEST['entry_id'], $HTTP_RAW_POST_DATA)) {
+ if (add_pingback($_REQUEST['entry_id'], $raw_post_data)) {
log_pingback('PINGBACK SUCCESS');;
report_pingback_success();
} else {
diff --git a/wfwcomment.php b/wfwcomment.php
index 8864c021..a0a45785 100644
--- a/wfwcomment.php
+++ b/wfwcomment.php
@@ -3,12 +3,13 @@
# All rights reserved. See LICENSE file for licensing details
include('serendipity_config.inc.php');
+$raw_post_data = file_get_contents("php://input");
-if ($_REQUEST['cid'] != '' && $HTTP_RAW_POST_DATA != '') {
+if ($_REQUEST['cid'] != '' && $raw_post_data != '') {
$comment = array();
- if (!preg_match('@]*>(.*)]*>@i', $HTTP_RAW_POST_DATA, $name)) {
- preg_match('@]*>(.*)]*>@i', $HTTP_RAW_POST_DATA, $name);
+ if (!preg_match('@]*>(.*)]*>@i', $raw_post_data, $name)) {
+ preg_match('@]*>(.*)]*>@i', $raw_post_data, $name);
}
if (isset($name[1]) && !empty($name[1])) {
@@ -20,11 +21,11 @@ if ($_REQUEST['cid'] != '' && $HTTP_RAW_POST_DATA != '') {
}
}
- if (preg_match('@]*>(.*)]*>@i', $HTTP_RAW_POST_DATA, $link)) {
+ if (preg_match('@]*>(.*)]*>@i', $raw_post_data, $link)) {
$comment['url'] = utf8_decode($link[1]);
}
- if (preg_match('@]*>(.*)]*>@ims', $HTTP_RAW_POST_DATA, $description)) {
+ if (preg_match('@]*>(.*)]*>@ims', $raw_post_data, $description)) {
if (preg_match('@^@ims', $description[1], $cdata)) {
$comment['comment'] = utf8_decode($cdata[1]);
} else {