Skip to content

Commit

Permalink
fix(兼容性): php8.1下可能会出现的错误
Browse files Browse the repository at this point in the history
  • Loading branch information
bymoye committed Dec 10, 2021
1 parent 971f4ff commit b2f124b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1676,7 +1676,7 @@ function change_avatar($avatar)
if (get_comment_meta($comment->comment_ID, 'new_field_qq', true)) {
$qq_number = get_comment_meta($comment->comment_ID, 'new_field_qq', true);
if (iro_opt('qq_avatar_link') == 'off') {
return '<img src="https://q2.qlogo.cn/headimg_dl?dst_uin=' . $qq_number . '&spec=100" data-src="' . stripslashes($m[1] ?? null) . '" class="lazyload avatar avatar-24 photo" alt="😀" width="24" height="24" onerror="imgError(this,1)">';
return '<img src="https://q2.qlogo.cn/headimg_dl?dst_uin=' . $qq_number . '&spec=100" data-src="' . stripslashes($m[1] ?? '') . '" class="lazyload avatar avatar-24 photo" alt="😀" width="24" height="24" onerror="imgError(this,1)">';
} elseif (iro_opt('qq_avatar_link') == 'type_3') {
$qqavatar = file_get_contents('http://ptlogin2.qq.com/getface?appid=1006102&imgtype=3&uin=' . $qq_number);
preg_match('/:\"([^\"]*)\"/i', $qqavatar, $matches);
Expand Down
5 changes: 2 additions & 3 deletions inc/categories-images.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ function z_init() {
$z_taxonomies = get_taxonomies();
if (is_array($z_taxonomies)) {
$zci_options = get_option('zci_options');
if (empty($zci_options['excluded_taxonomies']))
$zci_options['excluded_taxonomies'] = array();
$excluded_taxonomies = $zci_options['excluded_taxonomies'] ?? [];

foreach ($z_taxonomies as $z_taxonomy) {
if (in_array($z_taxonomy, $zci_options['excluded_taxonomies']))
if (in_array($z_taxonomy, $excluded_taxonomies))
continue;
add_action($z_taxonomy.'_add_form_fields', 'z_add_texonomy_field');
add_action($z_taxonomy.'_edit_form_fields', 'z_edit_texonomy_field');
Expand Down
2 changes: 1 addition & 1 deletion tpl/content-thumb.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
</span>
</div>
<div class="float-content">
<?php substr(the_excerpt(), 0, 3); ?>
<?php the_excerpt() ?>
<div class="post-bottom">
<a href="<?php the_permalink(); ?>" class="button-normal"><i class="iconfont icon-caidan"></i></a>
</div>
Expand Down

0 comments on commit b2f124b

Please sign in to comment.