X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Ffilter%2Ffilter.module;h=e1d3657574f85e86e8bedf770413aaa90d2b5204;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hp=1497aba2eee74c64064c5d468945af6f1b4a7bf8;hpb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;p=yaffs-website diff --git a/web/core/modules/filter/filter.module b/web/core/modules/filter/filter.module index 1497aba2e..e1d365757 100644 --- a/web/core/modules/filter/filter.module +++ b/web/core/modules/filter/filter.module @@ -74,7 +74,7 @@ function filter_theme() { 'caption' => NULL, 'classes' => NULL, ], - ] + ], ]; } @@ -773,7 +773,7 @@ function _filter_html_escape($text) { function _filter_html_image_secure_process($text) { // Find the path (e.g. '/') to Drupal root. $base_path = base_path(); - $base_path_length = Unicode::strlen($base_path); + $base_path_length = mb_strlen($base_path); // Find the directory on the server where index.php resides. $local_dir = \Drupal::root() . '/'; @@ -789,11 +789,11 @@ function _filter_html_image_secure_process($text) { // Verify that $src starts with $base_path. // This also ensures that external images cannot be referenced. $src = $image->getAttribute('src'); - if (Unicode::substr($src, 0, $base_path_length) === $base_path) { + if (mb_substr($src, 0, $base_path_length) === $base_path) { // Remove the $base_path to get the path relative to the Drupal root. // Ensure the path refers to an actual image by prefixing the image source // with the Drupal root and running getimagesize() on it. - $local_image_path = $local_dir . Unicode::substr($src, $base_path_length); + $local_image_path = $local_dir . mb_substr($src, $base_path_length); $local_image_path = rawurldecode($local_image_path); if (@getimagesize($local_image_path)) { // The image has the right path. Erroneous images are dealt with below.