Plugin Directory

Changeset 1824383


Ignore:
Timestamp:
02/19/2018 08:52:30 AM (8 years ago)
Author:
Vicomi
Message:

Support php 7

Location:
voting-platform-feelbacks/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • voting-platform-feelbacks/trunk/lib/url.php

    r1803409 r1824383  
    44
    55function _vcf_get_query_string($pdata) {
    6     $pdatastring = '';
    7 
     6    $postdata_str = '';
     7   
    88    if($pdata) {
    99        foreach($pdata as $key=>$value) {
     
    7575
    7676    $data = curl_exec($c);
    77     list($headers, $response['data']) = explode("\r\n\r\n", $data, 2);
     77   
     78    $dataExplode = explode("\r\n\r\n", $data, 2);
     79   
     80    if (version_compare(PHP_VERSION, '7.0.0') >= 0) {
     81        /*echo 'I am at least PHP version 7.0.0, my version: ' . PHP_VERSION . "\n";*/
     82        /* check number of elements in $dataExplode array  */
     83        if(count($dataExplode) >= 2){
     84            list($headers, $response['data']) = $dataExplode;
     85        }elseif(count($dataExplode) == 1){
     86            list($headers) = $dataExplode;
     87            $response['data'] = '';
     88        }
     89    }else{
     90        list($headers, $response['data']) = $dataExplode;
     91    }
     92   
    7893   
    7994    $response['headers'] = _vcf_get_response_headers($headers, $response);
     
    8297
    8398function _vcf_get_response_headers($headers, &$response) {
     99   
    84100    $headers = explode("\r\n", $headers);
    85     list($unused, $response['code'], $unused) = explode(' ', $headers[0], 3);
     101    $headersExplode = explode(' ', $headers[0], 3);
     102   
     103    if (version_compare(PHP_VERSION, '7.0.0') >= 0) {
     104        if(count($headersExplode) >= 3){
     105            list($unused, $response['code'], $unused) = $headersExplode;
     106        }elseif(count($headersExplode) == 2){
     107            list($unused, $response['code']) = $headersExplode;
     108        }elseif(count($headersExplode) == 1){
     109            list($unused) = $headersExplode;
     110            $response['code'] = '';
     111        }
     112    }else{
     113        list($unused, $response['code'], $unused) = $headersExplode;
     114    }
     115   
    86116    $headers = array_slice($headers, 1);
    87117
  • voting-platform-feelbacks/trunk/lib/vc-api.php

    r1811647 r1824383  
    2828        var $api_version = '1.1';
    2929
    30         function VicomiAPI() {
     30        function __construct() {
    3131            $this->last_error = null;
    3232            $this->api_url = 'http://dashboard.vicomi.com/';
  • voting-platform-feelbacks/trunk/readme.txt

    r1811647 r1824383  
    55License URI: http://www.gnu.org/licenses/gpl-2.0.html
    66Requires at least: 2.8 or higher
    7 Tested up to: 4.9.1
     7Tested up to: 4.9.4
    88Stable tag: 2.05
    99
     
    166166== Changelog ==
    167167
     168= 2.05 =
     169* Now supports php 7
     170
    168171= 2.04 =
    169172* Updating to faster servers
     
    191194== Upgrade Notice ==
    192195
     196= 2.05 =
     197* Now supports php 7
     198
    193199= 2.04 =
    194200* Updating to faster servers
  • voting-platform-feelbacks/trunk/vicomi-feelbacks.php

    r1811647 r1824383  
    55Description: Feelbacks is a new voting engagement widget that allows users to express their feelings about your content
    66Author: Vicomi <support@vicomi.com>
    7 Version: 2.04
     7Version: 2.05
    88Author URI: http://vicomi.com/
    99*/
    1010
    1111require_once(dirname(__FILE__) . '/lib/vc-api.php');
    12 define('VICOMI_FEELBACKS_V', '2.04');
     12define('VICOMI_FEELBACKS_V', '2.05');
    1313include_once(dirname(__FILE__) . '/settings-page.php');
    1414
Note: See TracChangeset for help on using the changeset viewer.