summaryrefslogtreecommitdiff
path: root/includes/common.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/common.inc')
-rw-r--r--includes/common.inc16
1 files changed, 14 insertions, 2 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 60a383603..e5c23fcab 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -822,11 +822,23 @@ function format_date($timestamp, $type = "medium", $format = "") {
function format_name($object) {
if ($object->uid && $object->name) {
+ /*
+ ** Shorten the name when it is too long or it will break many
+ ** tables.
+ */
+
+ if (strlen($object->name) > 20) {
+ $name = substr($object->name, 0, 15) ."...";
+ }
+ else {
+ $name = $object->name;
+ }
+
if (arg(0) == "admin") {
- $output = l($object->name, "admin/user/edit/$object->uid", array("title" => t("Administer user profile.")));
+ $output = l($name, "admin/user/edit/$object->uid", array("title" => t("Administer user profile.")));
}
else {
- $output = l($object->name, "user/view/$object->uid", array("title" => t("View user profile.")));
+ $output = l($name, "user/view/$object->uid", array("title" => t("View user profile.")));
}
}
else if ($object->name) {