/** * Extended to pass URLs through Laravel. * * @internal * @param array $matches * @return string * @uses Laravel\URL::to_asset() */ function _doImages_inline_callback($matches) { $alt_text = $matches[2]; $url = $matches[3] == '' ? $matches[4] : $matches[3]; $title = isset($matches[7]) ? $matches[7] : null; $alt_text = $this->encodeAttribute($alt_text); $url = $this->encodeAttribute($url); // BEGIN: Modification to pass URLs through Laravel if ($url[0] !== '#' and is_null(parse_url($url, PHP_URL_SCHEME))) { $url = Laravel\URL::to_asset($url); } // END $result = "<img src=\"{$url}\" alt=\"{$alt_text}\""; if (isset($title)) { $title = $this->encodeAttribute($title); $result .= " title=\"{$title}\""; # $title already quoted } $result .= $this->empty_element_suffix; return $this->hashPart($result); }
/** * Generate an application URL to an asset. * * @param string $url * @param bool $https * @return string */ function asset($url, $https = null) { return Laravel\URL::to_asset($url, $https); }
/** * Generate an application URL to an asset. * * @param string $url * @param bool $https * @return string */ function asset($url, $https = false) { return Laravel\URL::to_asset($url, $https); }