summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/wordpress-mobile-pack/export/class-export.php')
-rwxr-xr-xplugins/wordpress-mobile-pack/export/class-export.php44
1 files changed, 4 insertions, 40 deletions
diff --git a/plugins/wordpress-mobile-pack/export/class-export.php b/plugins/wordpress-mobile-pack/export/class-export.php
index 9e2fb424..3cf19909 100755
--- a/plugins/wordpress-mobile-pack/export/class-export.php
+++ b/plugins/wordpress-mobile-pack/export/class-export.php
@@ -1140,44 +1140,6 @@ if ( ! class_exists( 'WMobilePack_Export' ) ) {
/**
- * Get array with HTTP hosts that are allowed to save comments.
- *
- * @param bool $webapp_id = The webapp id (from Premium settings), used to check the comments token.
- * @return array
- *
- */
- protected function get_comments_allowed_hosts(&$webapp_id = false){
-
- $allowed_hosts = array(
- $_SERVER["HTTP_HOST"]
- );
-
- if (WMobilePack_Options::get_setting('premium_active') == 1 && WMobilePack_Options::get_setting('premium_api_key') != '') {
-
- if (!class_exists('WMobilePack_Premium')) {
- require_once(WMP_PLUGIN_PATH . 'inc/class-wmp-premium.php');
- }
-
- $premium_manager = new WMobilePack_Premium();
- $arr_config_premium = $premium_manager->get_premium_config();
-
- if ($arr_config_premium !== null) {
-
- $allowed_hosts[] = WMP_APPTICLES_PREVIEW_DOMAIN.'/'.$arr_config_premium['shorten_url'];
-
- if (isset($arr_config_premium['domain_name']) && filter_var('http://'.$arr_config_premium['domain_name'], FILTER_VALIDATE_URL)) {
- $allowed_hosts[] = $arr_config_premium['domain_name'];
- }
-
- $webapp_id = $arr_config_premium['webapp'];
- }
- }
-
- return $allowed_hosts;
- }
-
-
- /**
* The save_comment method is used for adding a comment to an article.
*
* The method returns a JSON with the success/error message.
@@ -1199,7 +1161,9 @@ if ( ! class_exists( 'WMobilePack_Export' ) ) {
public function save_comment()
{
- $allowed_hosts = $this->get_comments_allowed_hosts($webapp_id);
+ $allowed_hosts = array(
+ $_SERVER["HTTP_HOST"]
+ );
$is_allowed = false;
@@ -1226,7 +1190,7 @@ if ( ! class_exists( 'WMobilePack_Export' ) ) {
}
// if the token is valid, go ahead and save comment to the DB
- if (WMobilePack_Tokens::check_token($_GET['code'], $webapp_id)) {
+ if (WMobilePack_Tokens::check_token($_GET['code'])) {
$arr_response = array(
'status' => 0,