Plugin Directory

Changeset 1104510


Ignore:
Timestamp:
03/03/2015 10:49:36 PM (11 years ago)
Author:
ShopSite
Message:

Don't require SSL verification of secure URLs.

Location:
shopsite-plugin/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • shopsite-plugin/trunk/readme.txt

    r1097525 r1104510  
    2626
    2727== Changelog ==
     28= 1.5.2 =
     29* Don't require SSL verification of secure URLs.
     30
    2831= 1.5.1 =
    2932* Renamed options and variables to minimize potential conflict with other plugins. Minor UI changes. Delete data when deleting plugin.
  • shopsite-plugin/trunk/shopsite.php

    r1097525 r1104510  
    22/**
    33 * @package ShopSite
    4  * @version 1.5.1
     4 * @version 1.5.2
    55 */
    66/*
     
    99Description: ShopSite plugin to put products into your WordPress blog
    1010Author: ShopSite
    11 Version: 1.5.1
     11Version: 1.5.2
    1212Author URI: http://shopsite.com/
    1313*/
     
    5858
    5959function load_plugin() {
    60     $version = "1.5.1";
     60    $version = "1.5.2";
    6161    if ( is_admin() ) { 
    6262      $running_version = get_option('ss_version');
     
    408408    $shopsite_url = get_option('ss_shopsite_url');
    409409    $url = $shopsite_url."&operation=get_setting&setting=output_url"; 
    410     $outputurl = curl_open($url);
    411     if (strlen($outputurl) > 10) {
     410    $outputurl = curl_open($url)[0];
     411    if ($outputurl && strlen($outputurl) > 10) {
    412412      $media_url = $outputurl."/media/";
    413413      update_option('ss_media_url', $media_url);
     
    633633  ini_set('allow_url_fopen', $url_openable);
    634634    print(stream_get_contents($handle));*/
    635   print(curl_open($url));
     635  $product_data = curl_open($url)[0];
     636  if ($product_data)
     637    print($product_data);
     638  else
     639    print($product_data[1]);
    636640}
    637641
     
    651655   
    652656 
    653    
    654   /*$shopsite_url = get_option('shopsite_url');
    655   $url_openable = ini_get('allow_url_fopen');
    656   ini_set('allow_url_fopen', true);
    657   $url = $shopsite_url;
    658   $handle = fopen($url,'r');
    659   ini_set('allow_url_fopen', $url_openable);
    660  
    661   if ($handle == false)
    662     return array("success"=>false, "error"=>"Check your callback URL");*/
    663  
    664   if (curl_open(get_option('ss_shopsite_url')) == false)
    665     return array("success"=>false, "error"=>"Check your callback URL");
     657  $res = curl_open(get_option('ss_shopsite_url'));
     658  if ($res[0] == false)
     659    return array("success"=>false, "error"=>$res[1]);
    666660 
    667661  return array("success"=>true);
     
    677671  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    678672  curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
     673  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
     674  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    679675  $html = curl_exec($ch);
     676  if (curl_errno($ch))
     677    $retval = array(false, curl_error($ch));
     678  else
     679    $retval = array($html);
     680
    680681  curl_close($ch);
    681682     
    682   return $html;
     683  return $retval;
    683684}
    684685
Note: See TracChangeset for help on using the changeset viewer.