That screen capture of the code was from your functions.php module, not some other script. But it may be something in the G code you use for the site which sanitizes the entry field and does not allow any scripts to be saved. If it was a "server" restriction then I would not be able to save the script in the field directly (but I can).
The system doesn't sanitize code for database insertion, it does that for html printing and
only when you pass that second argument. There's no point in evaluate a function if you aren't looking where the function is being called rather than just the function declaration:
$safe_html is used only to cast those banners at Dashboard, because if I don't do that the system will show the banner (evaluates JS) rather than allow us to edit the field. In any case, $safe_html doesn't remove tags, it just do an entity encode. As you may notice, the render (actual function used for printing) forces $safe_html FALSE.
What happens when you insert that code into one of your ad blocks and click save. Does it stay in the ad block, or does your site also remove the entire <script> section?
At the demo I'm able to save a banner with mixed code.
You can check that it loads "Test" + ad code at the homepage. If I tell you that the system doesn't trim those is because I'm sure about it and you should just stop with the idea that Chevereto is trimming that code in that section. Here, taken from homepage:
(At my localhost I'm also able to do it and I'm running WIN Apache there).
I don't want misunderstandings with the functionality of that $safe_html flag so here is what happens when you use $safe_html = TRUE:
It doesn't strip tags it just convert the code from HTML to HTML entities so the code gets replaced to something like this:
Code:
TEST
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Homepage Leaderboard -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1234567890123456"
data-ad-slot="1234567890"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
That's why is a safe_html flag and not a strip_tags flag, because I'm doing entities not stripping.
Like I said, this is your server trimming the stuff and at this time Chevereto doesn't support any non-standard server extra security module.
Cheers,
Rodolfo.