Plugin Directory

Changeset 1371777


Ignore:
Timestamp:
03/15/2016 07:27:48 PM (10 years ago)
Author:
bjoerne
Message:

Bugfix after changed instagram URLs: crop query part

Location:
ifttt-instagram-gallery/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • ifttt-instagram-gallery/trunk/README.txt

    r1150788 r1371777  
    44Tags: ifttt, ifthisthenthat, instagram, gallery
    55Requires at least: 3.9
    6 Tested up to: 4.2.1
     6Tested up to: 4.4.2
    77Stable tag: trunk
    88License: GPLv3
     
    118118= 1.0.3 =
    119119* Bugfix: Special characters led to broken title attributes of Instagram images and invalid html. Title attributes of images are now escaped with htmlspecialchars().
     120
     121= 1.0.4 =
     122* Bugfix after changed instagram URLs. Crop query part, e.g. invoke https://scontent-frt3-1.cdninstagram.com/t51.2885-15/e35/1208218_821804957925622_1457586436_n.jpg instead of https://scontent-frt3-1.cdninstagram.com/t51.2885-15/e35/1208218_821804957925622_1457586436_n.jpg?ig_cache_key=MTIwNDU4NDU1NzU3MjMxODAxNg%3D%3D.2
  • ifttt-instagram-gallery/trunk/ifttt-instagram-gallery.php

    r1013519 r1371777  
    1111 * Plugin URI:        http://www.bjoerne.com
    1212 * Description:       IFTTT Instagram Gallery is a highly configurable widget that automatically shares your latest Instagram pictures in an amazing looking photo grid on your WordPress blog.
    13  * Version:           1.0.3
     13 * Version:           1.0.4
    1414 * Author:            Björn Weinbrenner
    1515 * Author URI:        http://www.bjoerne.com/
  • ifttt-instagram-gallery/trunk/public/class-ifttt-instagram-gallery.php

    r1013519 r1371777  
    2929     * @var     string
    3030     */
    31     const VERSION = '1.0.3';
     31    const VERSION = '1.0.4';
    3232
    3333    /**
     
    116116        $title          = htmlspecialchars( $content_struct['title'] );
    117117        $description    = $content_struct['description'];
    118         $description_decoded = json_decode( $description, true ); 
     118        $description_decoded = json_decode( $description, true );
    119119        $instagram_url  = $this->get_final_url( $description_decoded['Url'] );
    120120        $image_url      = $this->get_final_url( $description_decoded['SourceUrl'] );
     
    133133    private function get_final_url( $url ) {
    134134        for ( $i = 0; $i < 5; $i++ ) {
     135            $url = $this->get_url_without_query( $url );
    135136            $response = wp_remote_head( $url, array( 'redirection' => 0 ) );
    136137            $reponse_code = wp_remote_retrieve_response_code( $response );
     
    146147            }
    147148        }
     149    }
     150
     151    /**
     152     * Returns the URL without query part.
     153     *
     154     * @since   1.0.2
     155     */
     156    private function get_url_without_query( $url ) {
     157        $url_parts = parse_url( $url );
     158        return $url_parts['scheme'] . '://' . $url_parts['host'] . $url_parts['path'];
    148159    }
    149160
Note: See TracChangeset for help on using the changeset viewer.