Skip to content

Commit 479a424

Browse files
committed
First change from the validation feedback
1 parent 5c86640 commit 479a424

11 files changed

Lines changed: 26 additions & 67 deletions

File tree

config/routing.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@ phpbbde_pastebin_main_controller:
22
path: /pastebin/
33
defaults:
44
_controller: 'phpbbde.pastebin.controller.main:handle'
5-
name: ""

controller/main.php

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,7 @@ public function __construct(
133133
$this->geshi_lang = $geshi_lang;
134134
}
135135

136-
/**
137-
* Handle all calls
138-
* @param string $name
139-
*/
140-
public function handle($name = '')
136+
public function handle()
141137
{
142138
$this->language->add_lang('pastebin', 'phpbbde/pastebin');
143139

@@ -152,20 +148,7 @@ public function handle($name = '')
152148
return $response;
153149
}
154150

155-
return $this->helper->render('pastebin_body.html', $this->language->lang('PASTEBIN'));
156-
}
157-
158-
/**
159-
* Adjust table naming correctly
160-
* @param string $name
161-
* @return string
162-
*/
163-
private function table($name)
164-
{
165-
if ($name == 'pastebin')
166-
{
167-
return $this->pastebin_table;
168-
}
151+
return $this->helper->render('@phpbbde/pastebin_pastebin_body.html', $this->language->lang('PASTEBIN'));
169152
}
170153

171154
/**
@@ -175,8 +158,6 @@ private function display_pb()
175158
{
176159
// Request variables
177160
$mode = $this->request->variable('mode', '');
178-
$confirm_id = $this->request->variable('confirm_id', '');
179-
$confirm_code = $this->request->variable('confirm_code', '');
180161
$snippet_id = $this->request->variable('s', 0);
181162
$submit = $this->request->is_set_post('submit');
182163

@@ -269,9 +250,9 @@ private function display_pb()
269250
}
270251

271252
$data = array(
272-
'snippet_title' => utf8_normalize_nfc(str_replace("\n", '', $this->request->variable('snippet_title', '', true))),
273-
'snippet_desc' => utf8_normalize_nfc(str_replace("\n", '', $this->request->variable('snippet_desc', '', true))),
274-
'snippet_text' => utf8_normalize_nfc($this->request->variable('snippet_text', '', true)),
253+
'snippet_title' => str_replace("\n", '', $this->request->variable('snippet_title', '', true)),
254+
'snippet_desc' => str_replace("\n", '', $this->request->variable('snippet_desc', '', true)),
255+
'snippet_text' => $this->request->variable('snippet_text', '', true),
275256
'snippet_prunable' => 1,
276257
'snippet_highlight' => $this->request->variable('snippet_highlight', ''),
277258
'snippet_prune_on' => max(1, min(6, $this->request->variable('pruning_months', 0))),
@@ -518,7 +499,6 @@ private function display_pb()
518499

519500
if ($this->request->is_set_post('cancel'))
520501
{
521-
//redirect(append_sid("{$root_path}support/pastebin.$phpEx", "mode=view&s=$snippet_id"));
522502
redirect($this->helper->route('phpbbde_pastebin_main_controller', array("mode"=>"view","s"=>$snippet_id)));
523503
}
524504

cron/main.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class main extends \phpbb\cron\task\base
2929

3030
/** @var \phpbb\log\log_interface */
3131
protected $log;
32-
32+
protected $pastebin_path;
3333
protected $prune_interval;
3434
protected $pastebin_table;
3535

@@ -80,14 +80,4 @@ public function should_run()
8080

8181
return $now > $this->config['phpbbde_pastebin_prune_last_run'] + $this->prune_interval;
8282
}
83-
84-
/**
85-
* Adjust table naming correctly
86-
* @param string $name
87-
* @return string
88-
*/
89-
private function table($name)
90-
{
91-
return $this->pastebin_table;
92-
}
9383
}

event/acp_events.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,6 @@ static public function getSubscribedEvents()
2626
);
2727
}
2828

29-
/**
30-
* Constructor
31-
*/
32-
public function __construct()
33-
{
34-
35-
}
36-
3729
/**
3830
* Add permissions for setting topic based posts per page settings.
3931
*

functions/pastebin.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\user $user, $
7272
'cfm' => 'cfm',
7373
'cpp-qt' => 'cpp',
7474
'css-gen.cfg' => 'cfg',
75-
'c_mac' => 'c',
7675
'd' => 'd',
7776
'delphi' => 'dpr',
7877
'div' => 'div',

language/de/pastebin.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
'COPY_PASTE_EXPLAIN' => 'Hier kannst du den Code kopieren und ihn in deinen bevorzugten Editor einfügen.',
2929
'SELECT_CODE' => 'Quellcode markieren',
3030

31+
'COLON' => ':',
32+
3133
'DELETE_SNIPPET' => 'Eintrag löschen',
3234
'DELETE_SNIPPET_CONFIRM' => 'Soll der Eintrag mit dem Titel “%s” wirklich gelöscht werden? Diese Aktion kann nicht rückgängig gemacht werden.',
3335
'DELETE_SNIPPET_EXPLAIN' => 'Löscht den Eintrag aus der Datenbank. Diese Aktion kann nicht rückgängig gemacht werden.',

language/en/pastebin.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
'COPY_PASTE_EXPLAIN' => 'Here, you can copy the source and paste it into your preferred editor.',
2828
'SELECT_CODE' => 'Mark all source code',
2929

30+
'COLON' => ':',
31+
3032
'DELETE_SNIPPET' => 'Delete entry',
3133
'DELETE_SNIPPET_CONFIRM' => 'Do you really want to delete the entry entitled “%s”? This cannot be undone.',
3234
'DELETE_SNIPPET_EXPLAIN' => 'Deletes the entry from the database. This cannot be undone.',

migrations/pastebin.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,4 @@ public function revert_data()
7777
array('config.remove', array('pastebin_version')),
7878
);
7979
}
80-
81-
private function table($name)
82-
{
83-
return $this->table_prefix . $name;
84-
}
8580
}

styles/prosilver/template/pastebin_body.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ <h3>{{ lang('MODERATE_SNIPPET') }}</h3>
2323
<fieldset class="fields1">
2424
{% if S_AUTH_EDIT %}
2525
<dl>
26-
<dt><label for="pruning_months">{{ lang('PRUNING_MONTHS') }}:</label></dt>
26+
<dt><label for="pruning_months">{{ lang('PRUNING_MONTHS') }}{{ lang('COLON') }}</label></dt>
2727
<dd><select name="pruning_months" id="pruning_months">{{ PRUNING_MONTHS_SELECT }}</select> {{ lang('PRUNING_MONTH_SHORT') }}</dd>
2828
</dl>
2929
<dl>
30-
<dt><label for="snippet_highlight">{{ lang('SNIPPET_HIGHLIGHT') }}:</label></dt>
30+
<dt><label for="snippet_highlight">{{ lang('SNIPPET_HIGHLIGHT') }}{{ lang('COLON') }}</label></dt>
3131
<dd><select id="snippet_highlight" name="snippet_highlight">{{ HIGHLIGHT_SELECT_MOD }}</select></dd>
3232
</dl>
3333
{% endif %}
3434
{% if S_AUTH_DELETE %}
3535
<dl>
36-
<dt><label for="delete_snippet">{{ lang('DELETE_SNIPPET') }}:</label></dt>
36+
<dt><label for="delete_snippet">{{ lang('DELETE_SNIPPET') }}{{ lang('COLON') }}</label></dt>
3737
<dd><label for="delete_snippet"><input type="checkbox" name="delete_snippet" id="delete_snippet" /> {{ lang('DELETE') }}</label></dd>
3838
</dl>
3939
{% endif %}
@@ -51,9 +51,9 @@ <h3>{{ lang('MODERATE_SNIPPET') }}</h3>
5151

5252
<div id="content">
5353
{% if S_MODE eq 'view' %}
54-
{% INCLUDE 'pastebin_view.html' %}
54+
{% INCLUDE '@phpbbde/pastebin_pastebin_view.html' %}
5555
{% else %}
56-
{% INCLUDE 'pastebin_post.html' %}
56+
{% INCLUDE '@phpbbde/pastebin_pastebin_post.html' %}
5757
{% endif %}
5858
</div>
5959

@@ -64,7 +64,7 @@ <h3>{{ lang('LATEST_SNIPPETS') }}</h3>
6464
{% if loops.latest_snippets|length %}
6565
<ul>
6666
{% for latest_snippets in loops.latest_snippets %}
67-
<li><a href="{{ latest_snippets.URL }}" title="{{ latest_snippets.TITLE }}{% if latest_snippets.DESC %}: {{ latest_snippets.DESC }}{% endif %}">{{ latest_snippets.TITLE_SHORT }}</a> ({{ latest_snippets.SNIPPET_TIME }}, {{ latest_snippets.AUTHOR_FULL }})</li>
67+
<li><a href="{{ latest_snippets.URL }}" title="{{ latest_snippets.TITLE }}{% if latest_snippets.DESC %}{{ lang('COLON') }} {{ latest_snippets.DESC }}{% endif %}">{{ latest_snippets.TITLE_SHORT }}</a> ({{ latest_snippets.SNIPPET_TIME }}, {{ latest_snippets.AUTHOR_FULL }})</li>
6868
{% endfor %}
6969
</ul>
7070
{% else %}

styles/prosilver/template/pastebin_post.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@ <h3>{{ lang('PASTEBIN_POST') }}</h3>
1717
<p class="error">{{ S_ERROR }}</p>
1818
{% endif %}
1919
<dl>
20-
<dt><label for="snippet_title">{{ lang('SNIPPET_TITLE') }}:</label></dt>
20+
<dt><label for="snippet_title">{{ lang('SNIPPET_TITLE') }}{{ lang('COLON') }}</label></dt>
2121
<dd><input type="text" size="45" maxlength="64" class="autowidth inputbox" name="snippet_title" id="snippet_title" value="{{ SNIPPET_TITLE }}" tabindex="1" /></dd>
2222
</dl>
2323
<dl>
24-
<dt><label for="snippet_desc">{{ lang('SNIPPET_DESC') }}:</label></dt>
24+
<dt><label for="snippet_desc">{{ lang('SNIPPET_DESC') }}{{ lang('COLON') }}</label></dt>
2525
<dd><input type="text" size="45" maxlength="64" class="autowidth inputbox" name="snippet_desc" id="snippet_desc" value="{{ SNIPPET_DESC }}" tabindex="2" /></dd>
2626
</dl>
2727
<dl>
28-
<dt><label for="snippet_highlight">{{ lang('SNIPPET_HIGHLIGHT') }}:</label></dt>
28+
<dt><label for="snippet_highlight">{{ lang('SNIPPET_HIGHLIGHT') }}{{ lang('COLON') }}</label></dt>
2929
<dd><select name="snippet_highlight" id="snippet_highlight">{{ HIGHLIGHT_SELECT }}</select></dd>
3030
</dl>
3131

3232
<dl>
33-
<dt><label for="pruning_months">{{ lang('PRUNING_MONTHS') }}:</label></dt>
33+
<dt><label for="pruning_months">{{ lang('PRUNING_MONTHS') }}{{ lang('COLON') }}</label></dt>
3434
<dd><select name="pruning_months" id="pruning_months">{{ PRUNING_MONTHS_SELECT }}</select> {{ lang('PRUNING_MONTH_SHORT') }}</dd>
3535
</dl>
3636

@@ -40,7 +40,7 @@ <h3>{{ lang('SNIPPET_TEXT') }}</h3>
4040

4141
<fieldset class="fields1">
4242
<dl>
43-
<dt><label for="fileupload">{{ lang('FILENAME') }}:</label></dt>
43+
<dt><label for="fileupload">{{ lang('FILENAME') }}{{ lang('COLON') }}</label></dt>
4444
<dd>
4545
<input type="file" name="fileupload" id="fileupload" maxlength="{{ FILESIZE }}" value="" class="inputbox autowidth" />
4646
</dd>

0 commit comments

Comments
 (0)