Plugin Directory

Changeset 1599472


Ignore:
Timestamp:
02/20/2017 07:47:11 AM (9 years ago)
Author:
pdf24
Message:

Fixed deprecated preg_replace with e modifier

Location:
pdf24-posts-to-pdf/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pdf24-posts-to-pdf/trunk/inc/common.php

    r1567106 r1599472  
    693693}
    694694
    695 function pdf24Plugin_getDate($str) {
    696     if(!$str || $str == '') {
    697         $str = 'Y-m-d';
    698     }
    699     return date($str);
    700 }
    701 
    702 function pdf24Plugin_parseDocFilename($name) {
     695function pdf24Plugin_parseDocFilename($name) { 
    703696    $repl = array(
    704697        '{blogName}' => get_bloginfo('name'),
     
    720713    );
    721714   
    722     $name = preg_replace('/\{date(:(.*?))?}/e', 'pdf24Plugin_getDate("$2")', $name);
     715    $name = preg_replace_callback('/\{date(:(.*?))?}/', function($m) {
     716        $dp = 'Y-m-d';
     717        if(isset($m[2]) && $m[2]) {
     718            $dp = $m[2];
     719        }
     720        return date($dp);
     721    }, $name);
    723722   
    724723    if(is_category()) {
     
    729728        $repl['{catNiceName}'] = $yourcat->category_nicename;
    730729    }
     730   
    731731    if(is_page()) {
    732732        global $post;
     
    739739        }
    740740    }
     741   
    741742    if(is_single()) {
    742743        global $post;
     
    749750        }
    750751    }
     752   
    751753    if(is_search()) {
    752754        if(function_exists('get_search_query')) {
     
    754756        }
    755757    }
     758   
    756759    if(is_home()) {
    757760    }
  • pdf24-posts-to-pdf/trunk/pdf24.php

    r1567106 r1599472  
    66Author: Stefan Ziegler
    77Author URI: https://www.pdf24.org
    8 Version: 4.1.0
     8Version: 4.1.1
    99License: GPL3
    1010*/
  • pdf24-posts-to-pdf/trunk/readme.txt

    r1567106 r1599472  
    44Tags: pdf, create pdf, convert to pdf, article to pdf, pdf plugin, pdf widget
    55Requires at least: 1.5.0
    6 Tested up to: 4.7
    7 Stable tag: 4.1.0
     6Tested up to: 4.7.2
     7Stable tag: 4.1.1
    88License: GPLv3
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    119119
    120120== Changelog ==
     121
     122= 4.1.1 =
     123* Fixed deprecated preg_replace with e modifier
    121124
    122125= 4.1.0 =
Note: See TracChangeset for help on using the changeset viewer.