$match[2]), $parameters); $url = call_user_func_array($method, $parameters); if (file_exists(AM_BASE_DIR . $url)) { return $match[1] . $url . $match[3]; } else { return $match[0]; } }, $str ); // Remove all temporary edit buttons inside HTML tags to avoid confusing the URL resolver. $str = preg_replace_callback( '/<([^>]+)>/s', function ($match) { return '<' . preg_replace('/' . PatternAssembly::inPageEditButton() . '/s', '', $match[1]) . '>'; }, $str ); // Find URLs in action, href and src attributes. // Note that all URLs in markdown code blocks will be ignored (<[^>]+). $str = preg_replace_callback( '/(<[^>]+(?:action|href|src))=((?:\\\\)?")(.+?)((?:\\\\)?")/is', function ($match) use ($method, $parameters) { $parameters = array_merge(array(0 => $match[3]), $parameters); $url = call_user_func_array($method, $parameters); // Matches 2 and 4 are quotes. return $match[1] . '=' . $match[2] . $url . $match[4]; }, $str ); // Inline styles (like background-image). // Note that all URLs in markdown code blocks will be ignored (<[^>]+). $str = preg_replace_callback( '/(<[^>]+)url\(\'?(.+?)\'?\)/is', function ($match) use ($method, $parameters) { $parameters = array_merge(array(0 => $match[2]), $parameters); $url = call_user_func_array($method, $parameters); return $match[1] . 'url(\'' . $url . '\')'; }, $str ); // Image srcset attributes. // Note that all URLs in markdown code blocks will be ignored (<[^>]+). $str = preg_replace_callback( '/(<[^>]+srcset)=((?:\\\\)?")([^"]+)((?:\\\\)?")/is', function ($match) use ($method, $parameters) { $urls = preg_replace_callback( '/([^,\s]+)\s+(\w+)/is', function ($match) use ($method, $parameters) { $parameters = array_merge(array(0 => $match[1]), $parameters); return call_user_func_array($method, $parameters) . ' ' . $match[2]; }, $match[3] ); // Matches 2 and 4 are quotes. return $match[1] . '=' . $match[2] . $urls . $match[4]; }, $str ); return $str; } } __halt_compiler();----SIGNATURE:----t8ZJCMLo9zHFpPYT2v3sKZ7ncF9tqW/FJeKVWSX8r+VPHGjMco1skZ+iVqCuNhT/X94DNlxkZnRjcjx+WOpd7vlH1uqwHlR/BdnIMZekhURlPHm8/Ews6ntMpHNWaQZiQB0nnBdCqLtjT1+Z0nxvqwsN2XaJStoQcMuJuozjCAmSVqbA1Kwq705PcYInqv0egjpoJaIqVYc65sLnRd1DW3u8bP46PI/3FMbbqvk3ziWx11ikUAFfmln82Kqu9krcjzPnkNeI1Jg9a/LNgoIN/8PuIFFIKvacJmw5JYSFfWKdcmuTziDh9vdWBvP8jTLNE+zTWwV2S4uqozdYnqabQRD3Ju51Y70d4aMAZ3QcaYU0A9ssjCkBjh5WHC0nVsJQFZ8QPT9QFPkH8h0yvjqXDn884+wJkR+uISRpHC1ltN+3G4L47wibnj3oQfQzDO9YuJ4dgPUDHhkh3Wk55OGUNjw1QuAxtZurx631HGEr6GjJx5GfHiCuxxUZQS3Qepi4yAxjhx+CleTgSIsh2CG2+lhCwE//eeBhNPRt2XLHeqk9nwiyRhxu0OXh38u5BJIqgH6luG3rMQu2fDdDMhfCsVQlVPEvJlUVzUssQpZB3aMlVfxDmgWNLc0OnFHJubxkvyNKCFed33CPQ9l4VecUD3oL3yXmxp9zq1dTgfrQo3s=----ATTACHMENT:----NzMxMjg0ODMxMDkyODIxMSA3NDUzNzA2MTAwMDAwNDY4IDQyNzY3NDUxMzQzNjY5Ng==