Plugin Directory

Changeset 3128891


Ignore:
Timestamp:
07/31/2024 03:17:38 PM (20 months ago)
Author:
urvanov
Message:

2.8.37 some php warnings

Location:
urvanov-syntax-highlighter/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • urvanov-syntax-highlighter/trunk/class-urvanov-syntax-highlighter-langs.php

    r2199554 r3128891  
    8484    public function detect($path, $fallback_id = NULL) {
    8585        $this->load();
    86         extract(pathinfo($path));
     86        if ( '' != $path) {
     87            extract(pathinfo($path));
     88        }
    8789
    8890        // If fallback id if given
  • urvanov-syntax-highlighter/trunk/class-urvanov-syntax-highlighter-plugin.php

    r3061820 r3128891  
    44Plugin URI: https://github.com/urvanov-ru/crayon-syntax-highlighter
    55Description: Supports multiple languages, themes, highlighting from a URL, local file or post text.
    6 Version: 2.8.36
     6Version: 2.8.37
    77Author: Fedor Urvanov, Aram Kocharyan
    88Author URI: https://urvanov.ru
     
    3535
    3636Urvanov_Syntax_Highlighter_Global::set_info(array(
    37     'Version' => '2.8.36',
    38     'Date' => '31th March 2024',
     37    'Version' => '2.8.37',
     38    'Date' => '31th August 2024',
    3939    'AuthorName' => 'Fedor Urvanov & Aram Kocharyan',
    4040    'PluginURI' => 'https://github.com/urvanov-ru/crayon-syntax-highlighter',
     
    741741
    742742    public static function pre_comment_text($text, $comment, $args ) {
     743        // according to
     744        // https://developer.wordpress.org/reference/hooks/comment_text/
     745        // this filter calls in different places.
     746        //
     747        // https://github.com/WordPress/WordPress/blob/01876b090612c0d2825a896a7ba0e7fd6dd6decc/wp-includes/comment.php#L48
     748        // calls it with $comment === null
     749        //
     750        // https://github.com/WordPress/WordPress/blob/bb26471543b104e047f9f4b264810adc372cd6ce/wp-includes/comment-template.php#L1094
     751        // calls it with the object $comment = get_comment( $comment_id ); as $comment
     752        if ($comment === null) {
     753            return $text;
     754        }
     755        // We process only call with filled $comment
    743756        $comment_id = strval($comment->comment_ID);
    744757        if (array_key_exists($comment_id, self::$comment_captures)) {
     
    749762    }
    750763
    751     public static function comment_text($text) {
    752         global $comment;
     764    public static function comment_text($text, $comment, $args ) {
     765        // according to
     766        // https://developer.wordpress.org/reference/hooks/comment_text/
     767        // this filter calls in different places.
     768        //
     769        // https://github.com/WordPress/WordPress/blob/01876b090612c0d2825a896a7ba0e7fd6dd6decc/wp-includes/comment.php#L48
     770        // calls it with $comment === null
     771        //
     772        // https://github.com/WordPress/WordPress/blob/bb26471543b104e047f9f4b264810adc372cd6ce/wp-includes/comment-template.php#L1094
     773        // calls it with the object $comment = get_comment( $comment_id ); as $comment
     774        if ($comment === null) {
     775            return $text;
     776        }
     777        // We process only call with filled $comment
    753778        $comment_id = strval($comment->comment_ID);
    754779        // Find if this post has Crayons
     
    13461371             Prevents Crayon from being formatted by the filters, and also keeps original comment formatting. */
    13471372            add_filter('comment_text', 'Urvanov_Syntax_Highlighter_Plugin::pre_comment_text', 1, 3);
    1348             add_filter('comment_text', 'Urvanov_Syntax_Highlighter_Plugin::comment_text', 100);
     1373            add_filter('comment_text', 'Urvanov_Syntax_Highlighter_Plugin::comment_text', 100, 3);
    13491374        }
    13501375
  • urvanov-syntax-highlighter/trunk/readme.txt

    r3061820 r3128891  
    44License: GPLv3 or later
    55Tags: syntax highlighter, syntax, highlighter, highlighting, crayon, code highlighter, bbpress
    6 Requires at least: 6.3
    7 Tested up to: 6.4.3
     6Requires at least: 6.6
     7Tested up to: 6.6.1
    88Stable tag: 2.8.36
    99
     
    334334== Changelog ==
    335335
     336= 2.8.???????????????????????????????? =
     337* FIXED
     338    * Warning message. PHP Deprecated: pathinfo(): Passing null to parameter #1 (https://wordpress.org/support/topic/passing-null-to-string-warning/)
     339    * Warning message. Trying to get property 'comment_ID' of non-object (https://wordpress.org/support/topic/comment_id-error/).
     340
    336341= 2.8.36 =
    337342* FIXED
     
    343348    * Warnings about global comment variable in comment highlighting.
    344349    * Minified min.js files.
     350
    345351= 2.8.34 =
    346352* ADDED
Note: See TracChangeset for help on using the changeset viewer.