Skip to content

Instantly share code, notes, and snippets.

@Abromeit
Created May 7, 2012 17:20
Show Gist options
  • Select an option

  • Save Abromeit/2629080 to your computer and use it in GitHub Desktop.

Select an option

Save Abromeit/2629080 to your computer and use it in GitHub Desktop.

Revisions

  1. Abromeit revised this gist May 7, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.aw
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@
    if( !empty($comment['comment_author_url']) )
    {
    $comment['comment_author_url'] = preg_replace(
    '/(plus\.google\.com.*?)(?:\?|&|&|&|&)rel\=author/i', '$1', $comment['comment_author_url']
    '/(plus\.google\.com.*?)(?:\?|&|&|&#0*38;|&#x0*26;)rel\=author/i', '$1', $comment['comment_author_url']
    );
    }

  2. Abromeit revised this gist May 7, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.aw
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@
    if( !empty($comment['comment_author_url']) )
    {
    $comment['comment_author_url'] = preg_replace(
    '#(plus\.google\.com.*?)(?:\?|&|&|&|&)rel\=author#i', '$1', $comment['comment_author_url']
    '/(plus\.google\.com.*?)(?:\?|&|&|&|&)rel\=author/i', '$1', $comment['comment_author_url']
    );
    }

  3. Abromeit revised this gist May 7, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.aw
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@
    if( !empty($comment['comment_author_url']) )
    {
    $comment['comment_author_url'] = preg_replace(
    '#(plus\.google\.com.*?)(?:\?|&|&)rel\=author#i', '$1', $comment['comment_author_url']
    '#(plus\.google\.com.*?)(?:\?|&|&|&|&)rel\=author#i', '$1', $comment['comment_author_url']
    );
    }

  4. Abromeit revised this gist May 7, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.aw
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@
    if( !empty($comment['comment_author_url']) )
    {
    $comment['comment_author_url'] = preg_replace(
    '/(plus\.google\.com.*?)(?:\?|&)rel\=author/i', '$1', $comment['comment_author_url']
    '#(plus\.google\.com.*?)(?:\?|&|&)rel\=author#i', '$1', $comment['comment_author_url']
    );
    }

  5. Abromeit revised this gist May 7, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.aw
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@
    if( !empty($comment['comment_author_url']) )
    {
    $comment['comment_author_url'] = preg_replace(
    '/(plus\.google\.com.*?)\?rel\=author/i', '$1', $comment['comment_author_url']
    '/(plus\.google\.com.*?)(?:\?|&)rel\=author/i', '$1', $comment['comment_author_url']
    );
    }

  6. Abromeit revised this gist May 7, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.aw
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@
    if( !empty($comment['comment_author_url']) )
    {
    $comment['comment_author_url'] = preg_replace(
    '/(plus\.google\.com.*)\?rel\=author/i', '$1', $comment['comment_author_url']
    '/(plus\.google\.com.*?)\?rel\=author/i', '$1', $comment['comment_author_url']
    );
    }

  7. Abromeit revised this gist May 7, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.aw
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@
    if( !empty($comment['comment_author_url']) )
    {
    $comment['comment_author_url'] = preg_replace(
    '/(plus\.google\.com.*)\?rel\=author/', '$1', $comment['comment_author_url']
    '/(plus\.google\.com.*)\?rel\=author/i', '$1', $comment['comment_author_url']
    );
    }

  8. Abromeit revised this gist May 7, 2012. 1 changed file with 12 additions and 37 deletions.
    49 changes: 12 additions & 37 deletions gistfile1.aw
    Original file line number Diff line number Diff line change
    @@ -1,42 +1,17 @@
    <?php
    /* Für PHP 5.3 */

    add_filter(
    'preprocess_comment',
    function($comment) {
    if ( !empty($comment['comment_author_url']) ) {
    $comment['comment_author_url'] = preg_replace(
    '/(plus.google.com)(.+?)\?rel=author/',
    '$1$2',
    $comment['comment_author_url']
    );
    }

    return $comment;
    }
    );
    function sm_preprocess_comment($comment)
    {
    if( !empty($comment['comment_author_url']) )
    {
    $comment['comment_author_url'] = preg_replace(
    '/(plus\.google\.com.*)\?rel\=author/', '$1', $comment['comment_author_url']
    );
    }

    /* Ende für PHP 5.3 */
    return $comment;
    }

    add_filter('preprocess_comment','sm_preprocess_comment');

    /* Für PHP kleiner 5.3 */

    function sm_preprocess_comment($comment) {
    if ( !empty($comment['comment_author_url']) ) {
    $comment['comment_author_url'] = preg_replace(
    '/(plus.google.com)(.+?)\?rel=author/',
    '$1$2',
    $comment['comment_author_url']
    );
    }

    return $comment;
    }

    add_filter(
    'preprocess_comment',
    'sm_preprocess_comment'
    );

    /* Ende für PHP kleiner 5.3 */
    *>
    ?>
  9. Sergej Müller revised this gist May 7, 2012. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion gistfile1.aw
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    <?php
    /* Für PHP 5.3 */

    add_filter(
    @@ -37,4 +38,5 @@ add_filter(
    'sm_preprocess_comment'
    );

    /* Ende für PHP kleiner 5.3 */
    /* Ende für PHP kleiner 5.3 */
    *>
  10. Sergej Müller created this gist May 7, 2012.
    40 changes: 40 additions & 0 deletions gistfile1.aw
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,40 @@
    /* Für PHP 5.3 */

    add_filter(
    'preprocess_comment',
    function($comment) {
    if ( !empty($comment['comment_author_url']) ) {
    $comment['comment_author_url'] = preg_replace(
    '/(plus.google.com)(.+?)\?rel=author/',
    '$1$2',
    $comment['comment_author_url']
    );
    }

    return $comment;
    }
    );

    /* Ende für PHP 5.3 */


    /* Für PHP kleiner 5.3 */

    function sm_preprocess_comment($comment) {
    if ( !empty($comment['comment_author_url']) ) {
    $comment['comment_author_url'] = preg_replace(
    '/(plus.google.com)(.+?)\?rel=author/',
    '$1$2',
    $comment['comment_author_url']
    );
    }

    return $comment;
    }

    add_filter(
    'preprocess_comment',
    'sm_preprocess_comment'
    );

    /* Ende für PHP kleiner 5.3 */