diff options
Diffstat (limited to 'plugins/wordpress-mobile-pack/export')
3 files changed, 5 insertions, 137 deletions
diff --git a/plugins/wordpress-mobile-pack/export/class-export-settings.php b/plugins/wordpress-mobile-pack/export/class-export-settings.php index e0ba8d7c..12d3e6e0 100755 --- a/plugins/wordpress-mobile-pack/export/class-export-settings.php +++ b/plugins/wordpress-mobile-pack/export/class-export-settings.php @@ -170,97 +170,6 @@ if ( ! class_exists( 'WMobilePack_Export_Settings' ) ) { } /** - * Export manifest files for Android or Mozilla (Premium settings). - * - * The method receives a single GET param: - * - * - content = 'androidmanifest' or 'mozillamanifest' - * - * @return string - */ - public function export_manifest_premium(){ - - 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){ - - if (!isset($arr_config_premium['domain_name']) || $arr_config_premium['domain_name'] == '') { - - $blog_name = $arr_config_premium['title']; - - if (isset($arr_config_premium['kit_type']) && $arr_config_premium['kit_type'] == 'wpmp') { - $blog_name = urldecode($blog_name); - } - - // init response depending on the manifest type - if (isset($_GET['content']) && $_GET['content'] == 'androidmanifest') { - - $arr_manifest = array( - 'name' => $blog_name, - 'start_url' => home_url(), - 'display' => 'standalone' - ); - - } else { - - // remove domain name from the launch path - $launch_path = home_url(); - $launch_path = str_replace('http://' . $_SERVER['HTTP_HOST'], '', $launch_path); - $launch_path = str_replace('https://' . $_SERVER['HTTP_HOST'], '', $launch_path); - - $arr_manifest = array( - 'name' => $blog_name, - 'launch_path' => $launch_path, - 'developer' => array( - "name" => $blog_name - ) - ); - } - - // load icon path - $icon_path = false; - - if (isset($arr_config_premium['icon_path']) && $arr_config_premium['icon_path'] != '') { - - // Check if we have a secure https connection - $is_secure = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443; - - $cdn_apps = $is_secure ? $arr_config_premium['cdn_apps_https'] : $arr_config_premium['cdn_apps']; - $icon_path = $cdn_apps . "/" . $arr_config_premium['shorten_url'] . '/' . $arr_config_premium['icon_path']; - } - - // set icon depending on the manifest file type - if ($icon_path != false) { - - if ($_GET['content'] == 'androidmanifest') { - - $arr_manifest['icons'] = array( - array( - "src" => $icon_path, - "sizes" => "192x192" - ) - ); - - } else { - $arr_manifest['icons'] = array( - '152' => $icon_path, - ); - } - } - - return json_encode($arr_manifest); - } - } - } - } - - /** * * Export settings file. * 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, diff --git a/plugins/wordpress-mobile-pack/export/content.php b/plugins/wordpress-mobile-pack/export/content.php index 6f0f336f..3f6bd2c1 100755 --- a/plugins/wordpress-mobile-pack/export/content.php +++ b/plugins/wordpress-mobile-pack/export/content.php @@ -79,12 +79,7 @@ if ( isset( $_GET['content'] ) ) { case 'androidmanifest': case 'mozillamanifest': - - if ( isset( $_GET['premium'] ) && $_GET['premium'] == 1 ) { - echo $export_settings->export_manifest_premium(); - } else { - echo $export_settings->export_manifest(); - } + echo $export_settings->export_manifest(); break; case 'apptexts': |