Fix Warning: in_array() expects parameter 2 to be array, null givensteemCreated with Sketch.

in #utopian-io9 years ago

I have tried to enable the script tag in the posts/pages by using the following approach in one of my Wordpress blog (version 4.9)

steps to reproduce:

  1. add define define('CUSTOM_TAGS', true); in wp_config.php
  2. add the following to functions.php template
function add_scriptfilter( $string ) {
  global $allowedtags;
  $allowedtags['script'] = array( 'src' => array () );
  return $string;
}
add_filter( 'pre_kses', 'add_scriptfilter' );

and it will show this warnings to all pages/posts:

Warning: in_array() expects parameter 2 to be array, null given in wp-includes/kses.php on line 1416

The error is quite straightforward, and therefore I fix it and create a PR, which I hope that can be merged into next release!

The PR is at:
https://github.com/WordPress/WordPress/pull/321

image.png



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for your contribution.
At the moment though, the contribution cannot be accepted yet as your PR has not be accepted/merged into wordpress code.
See the Utopian Rules.
Once that happens, you may edit your post and resubmit for approval.

You can contact us on Discord.
[utopian-moderator]

Thanks.. so if the PR has not been accepted in 7 days but got accepted later, can I repost this?

yes that would definitely work :)

Coin Marketplace

STEEM 0.04
TRX 0.33
JST 0.089
BTC 62636.75
ETH 1770.32
USDT 1.00
SBD 0.39