Plugin Directory

Changeset 624727

Timestamp:
11/13/2012 05:42:49 PM (12 years ago)
Author:
martinremy
Message:

Fix URL transform for chart URLs to allow query strings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • jetpack/trunk/modules/stats.php

    r622277 r624727  
    446446
    447447function stats_convert_chart_urls( $html ) {
    448     $html = preg_replace( '|https?://[-.a-z0-9]+/wp-includes/charts/([-.a-z0-9]+).php|', 'admin.php?page=stats&noheader&chart=$1', $html );
     448    $html = preg_replace_callback( '|https?://[-.a-z0-9]+/wp-includes/charts/([-.a-z0-9]+).php(\??)|',
     449            create_function(
     450                '$matches',
     451                // If there is a query string, change the beginning '?' to a '&' so it fits into the middle of this query string
     452                'return "admin.php?page=stats&noheader&chart=" . $matches[1] . str_replace( "?", "&", $matches[2] );'
     453            ),
     454            $html );
    449455    return $html;
    450456}
Note: See TracChangeset for help on using the changeset viewer.