Skip to content

Instantly share code, notes, and snippets.

@shabbirbhimani
Created May 4, 2017 03:09
Show Gist options
  • Save shabbirbhimani/b5ee238b6455bdd92f07a846e60a4aae to your computer and use it in GitHub Desktop.
Save shabbirbhimani/b5ee238b6455bdd92f07a846e60a4aae to your computer and use it in GitHub Desktop.
Hook bbcode_img_match and add the following code
<?php
//* Do NOT include the opening php tag above. Copy the code shown below.
$urlbits = parse_url($link);
$salt = 'XXXX';
if ($urlbits['scheme']!='https')
$link = '/imgproxy.php?u='.urlencode($link).'&h='.md5($salt.$link.$salt);
$retval = ($fullsize ? '<div class="size_fullsize">' : '') . '<img src="' . $link . '" border="0" alt="" />' . ($fullsize ? '</div>' : '');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment