Skip to content

Commit d3a6725

Browse files
committed
Add ellipsis and remove non required require()
1 parent d06546d commit d3a6725

3 files changed

Lines changed: 3 additions & 9 deletions

File tree

controller/main.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ class main
6666
/** @var \phpbb\captcha\factory */
6767
protected $captcha_factory;
6868

69-
/** @var string */
70-
protected $geshi_path;
71-
7269
/** @var string */
7370
protected $geshi_lang;
7471

@@ -108,7 +105,6 @@ public function __construct(
108105
\phpbbde\pastebin\functions\pastebin $pastebin,
109106
$root_path,
110107
$php_ext,
111-
$geshi_path,
112108
$geshi_lang,
113109
$pastebin_table)
114110
{
@@ -128,7 +124,6 @@ public function __construct(
128124
$this->util = $util;
129125
$this->captcha_factory = $captcha_factory;
130126

131-
$this->geshi_path = $geshi_path;
132127
$this->pastebin_table = $pastebin_table;
133128
$this->geshi_lang = $geshi_lang;
134129
}
@@ -217,7 +212,7 @@ private function display_pb()
217212
'DESC' => $row['snippet_desc'],
218213
'TITLE' => $row['snippet_title'],
219214
'SNIPPET_TIME' => $this->user->format_date($row['snippet_time']),
220-
'TITLE_SHORT' => (utf8_strlen($row['snippet_title']) > 50) ? utf8_substr($row['snippet_title'], 0, 50) . '...' : $row['snippet_title'],
215+
'TITLE_SHORT' => (utf8_strlen($row['snippet_title']) > 25) ? utf8_substr($row['snippet_title'], 0, 25) . $this->language->lang('ELLIPSIS') : $row['snippet_title'],
221216
'AUTHOR_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
222217
));
223218
}
@@ -398,9 +393,6 @@ private function display_pb()
398393
$highlight = 'php';
399394
}
400395

401-
// highlight using geshi (http://qbnz.com/highlighter/)
402-
require($this->geshi_path . 'geshi.' . $this->php_ext);
403-
404396
$code = htmlspecialchars_decode($snippet_text);
405397

406398
$geshi = new \GeSHi($code, $highlight, $this->util->geshi_dir);

language/de/pastebin.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
'SELECT_CODE' => 'Quellcode markieren',
3030

3131
'COLON' => ':',
32+
'ELLIPSIS' => '',
3233

3334
'DELETE_SNIPPET' => 'Eintrag löschen',
3435
'DELETE_SNIPPET_CONFIRM' => 'Soll der Eintrag mit dem Titel “%s” wirklich gelöscht werden? Diese Aktion kann nicht rückgängig gemacht werden.',

language/en/pastebin.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
'SELECT_CODE' => 'Mark all source code',
2929

3030
'COLON' => ':',
31+
'ELLIPSIS' => '',
3132

3233
'DELETE_SNIPPET' => 'Delete entry',
3334
'DELETE_SNIPPET_CONFIRM' => 'Do you really want to delete the entry entitled “%s”? This cannot be undone.',

0 commit comments

Comments
 (0)