Plugin Directory

Changeset 958291


Ignore:
Timestamp:
07/31/2014 08:17:07 PM (12 years ago)
Author:
zubaka
Message:

Get rid limit of preg_replace() problems by exact number of expected replaces

Location:
zbplayer/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • zbplayer/trunk/readme.txt

    r941446 r958291  
    55Requires at least: 3.5
    66Tested up to: 3.9.1
    7 Stable tag: 2.1.6
     7Stable tag: 2.1.7
    88License: Dual Licensed under the MIT and GPLv2 or later
    99
     
    5151
    5252== Changelog ==
     53
     54= 2.1.7 =
     55*    Get rid limit of preg_replace() problems by exact number of expected replaces
    5356
    5457= 2.1.6 =
  • zbplayer/trunk/zbPlayer.admin.php

    r941446 r958291  
    77 *
    88 *  zbPlayer.admin.php
    9  *  Release 2.1.6 July 2014
     9 *  Release 2.1.7 July 2014
    1010 */
    1111// connect wordpress color picker
  • zbplayer/trunk/zbPlayer.php

    r941446 r958291  
    44Plugin URI: http://gilevich.com/portfolio/zbplayer
    55Description: Converts mp3 files links to a small flash player and a link to download file mp3 file. Also you can share your mp3 files with that plugin.
    6 Version: 2.1.6
     6Version: 2.1.7
    77Author: Vladimir Gilevich
    88Author URI: http://gilevich.com/
     
    1010*/
    1111
    12 define('ZBPLAYER_VERSION', "2.1.6");
     12define('ZBPLAYER_VERSION', "2.1.7");
    1313define('ZBPLAYER_DEFAULT_WIDTH', "500");
    1414define('ZBPLAYER_DEFAULT_INITIALVOLUME', "60");
     
    120120            }
    121121        } else {
    122             $result = preg_replace_callback( $pattern, "zbp_insert_player", $content );
     122            // let's try find exact value or expected replaces to do not have limit problems with preg_replace()
     123            preg_match_all( $pattern, $content, $matches );
     124            $expectedReplaces = (is_array($matches) && count($matches)) ? count($matches[0]) : -1;
     125            $result = preg_replace_callback( $pattern, "zbp_insert_player", $content, $expectedReplaces );
    123126            // fix if error occured for preg_replace_callback()
    124127            $content = empty($result) ? $content : $result;
Note: See TracChangeset for help on using the changeset viewer.