Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix shorten_utf8

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@920 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information...
commit fa7b86ca049ad5fdd84a9cb0fd25c7bedf142f5b 1 parent 6c97b80
jakubvrana authored

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. +1 1  adminer/include/functions.inc.php
2  adminer/include/functions.inc.php
@@ -251,7 +251,7 @@ function is_utf8($val) {
251 251 }
252 252
253 253 function shorten_utf8($string, $length = 80, $suffix = "") {
254   - preg_match("~^(.{0,$length})(.?)~su", $string, $match);
  254 + preg_match("~^((?:.|\n){0,$length})(.|\n)?~u", $string, $match); // ~s causes trash in $match[2] under some PHP versions
255 255 return htmlspecialchars($match[1]) . $suffix . ($match[2] ? "<em>...</em>" : "");
256 256 }
257 257

0 comments on commit fa7b86c

Please sign in to comment.
Something went wrong with that request. Please try again.