WordPress.org

Plugin Directory

Changeset 570667


Ignore:
Timestamp:
07/11/12 15:21:08 (22 months ago)
Author:
dimadin
Message:

Pass rating that is allowed on a site to checker if other than G. Props Parakoos for bug report and initial patch.

Location:
gravatar-signup-encouragement/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • gravatar-signup-encouragement/trunk/gravatar-check.php

    r533652 r570667  
    2020 * and worldclimb at gmail dot com (  http://php.net/file_exists#76545 ) 
    2121 */ 
    22 $fileUrl = "http://www.gravatar.com/avatar/" . md5( strtolower( $gravatar_email ) ) . "?s=2&d=404"; 
     22$fileUrl = 'http://www.gravatar.com/avatar/' . md5( strtolower( $gravatar_email ) ) . '?s=2&d=404'; 
     23 
     24$rating = $_GET['r']; 
     25if ( ! empty( $rating ) ) 
     26    $fileUrl .= '&r=' . $rating; 
     27 
    2328$AgetHeaders = @get_headers( $fileUrl ); 
    2429if ( ! preg_match( "|200|", $AgetHeaders[0] ) ) { 
  • gravatar-signup-encouragement/trunk/gravatar-signup-encouragment.php

    r533649 r570667  
    247247 */ 
    248248function gravatar_signup_encouragement_check_url() { 
    249     if ( gravatar_signup_encouragement_allow_url_fopen() ) 
    250         return plugins_url( 'gravatar-check.php', __FILE__ ); 
    251     else 
     249    if ( gravatar_signup_encouragement_allow_url_fopen() ) { 
     250        $url = plugins_url( 'gravatar-check.php', __FILE__ ); 
     251 
     252        /* Pass rating if not G */ 
     253        if ( 'G' != get_option( 'avatar_rating' ) ) 
     254            $url = add_query_arg( 'r', get_option( 'avatar_rating' ), $url ); 
     255 
     256        return $url; 
     257    } else { 
    252258        return admin_url( 'admin-ajax.php' ); 
     259    } 
    253260} 
    254261 
     
    541548 */ 
    542549function gravatar_signup_encouragement_check_gravatar_existence( $email ) { 
    543     $fileUrl = "http://www.gravatar.com/avatar/" . md5( strtolower( $email ) )."?s=2&d=404"; 
     550    $fileUrl = 'http://www.gravatar.com/avatar/' . md5( strtolower( $email ) ) . '?s=2&d=404'; 
     551 
     552    /* Pass rating if not G */ 
     553    if ( 'G' != get_option( 'avatar_rating' ) ) 
     554        $fileUrl .= '&r=' . get_option( 'avatar_rating' ); 
     555 
    544556    /* Lets first try with faster method */ 
    545557    if ( gravatar_signup_encouragement_allow_url_fopen() ) { 
Note: See TracChangeset for help on using the changeset viewer.