Skip to content

Commit

Permalink
changed callback declaration because php8.2 doesnt like self:
Browse files Browse the repository at this point in the history
  • Loading branch information
justinhunt committed Oct 13, 2023
1 parent 6d60ab4 commit 372a4f1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
6 changes: 5 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
Change List
=========
Version 3.1.71(2023101300)
- removed debugger statement
- removed deprecated calback call which php8.2 complained about

Version 3.1.70(Build 2023100400)
-- added more langs to passage reader and select to read
-- fixed bug wih player widgets which garbled non ascii text on the page!!
-- fixed bug with player widgets which garbled non ascii text on the page!!

Version 3.1.69(Build 2023062800)
- Made license manager tolerant of curl failures, and will reuse old license info until new info shows up
Expand Down
8 changes: 4 additions & 4 deletions filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function filter($text, array $options = array()) {
// non string data can not be filtered anyway
return $text;
}
$newtext = preg_replace_callback($search, 'self::filter_poodll_process', $newtext);
$newtext = preg_replace_callback($search, '\filter_poodll::filter_poodll_process', $newtext);
}

//if the text has a poodll player widget we want to prevent other filters from messing with it
Expand All @@ -85,18 +85,18 @@ public function filter($text, array $options = array()) {
$handleextstring = implode('|', $handleexts);
//$oldsearch = '/<a\s[^>]*href="([^"#\?]+\.(' . $handleextstring. '))(\?d=([\d]{1,4})x([\d]{1,4}))?"[^>]*>([^>]*)<\/a>/is';
$search = '/<a\s[^>]*href="([^"#\?]+\.(' . $handleextstring . '))(.*?)"[^>]*>([^>]*)<\/a>/is';
$newtext = preg_replace_callback($search, 'self::filter_poodll_allexts_callback', $newtext);
$newtext = preg_replace_callback($search, '\filter_poodll::filter_poodll_allexts_callback', $newtext);
}

//check for legacy pdl links
$search = '/<a\s[^>]*href="([^"#\?]+\.(pdl))(.*?)"[^>]*>([^>]*)<\/a>/is';
$newtext = preg_replace_callback($search, 'self::filter_poodll_pdl_callback', $newtext);
$newtext = preg_replace_callback($search, '\filter_poodll::filter_poodll_pdl_callback', $newtext);

//check for youtube
if ($this->fetchconf('handleyoutube')) {
$search =
'/<a\s[^>]*href="(?:https?:\/\/)?(?:www\.)?youtu(?:\.be|be\.com)\/(?:watch\?v=|v\/)?([\w-]{10,})(?:.*?)<\/a>/is';
$newtext = preg_replace_callback($search, 'self::filter_poodll_youtube_callback', $newtext);
$newtext = preg_replace_callback($search, '\filter_poodll::filter_poodll_youtube_callback', $newtext);
}
}// end of if $havelinks

Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2023100400;
$plugin->version = 2023101300;
$plugin->requires = 2016052300;//moodle 3.1.0
$plugin->component = 'filter_poodll';
$plugin->maturity = MATURITY_STABLE;
$plugin->release = '3.1.70(Build 2023100400)';
$plugin->release = '3.1.71(Build 2023101300)';

0 comments on commit 372a4f1

Please sign in to comment.