Completed
Push — 3.2.x ( 432710...c38ea3 )
by Erwan
05:33
created
controller/comments.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -191,7 +191,7 @@
 block discarded – undo
191 191
 	* Post a new comment
192 192
 	*
193 193
 	* @param	int	$link_id		The category ID
194
-	* @return	null
194
+	* @return	\Symfony\Component\HttpFoundation\Response|null
195 195
 	* @throws	\phpbb\exception\http_exception
196 196
 	*/
197 197
 	public function new_comment($link_id)
Please login to merge, or discard this patch.
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -78,16 +78,16 @@  discard block
 block discarded – undo
78 78
 	*/
79 79
 	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\pagination $pagination, \phpbb\captcha\factory $captcha_factory, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\comment $comment, $root_path, $php_ext)
80 80
 	{
81
-		$this->db				= $db;
82
-		$this->config			= $config;
81
+		$this->db = $db;
82
+		$this->config = $config;
83 83
 		$this->language			= $language;
84 84
 		$this->template			= $template;
85 85
 		$this->user				= $user;
86
-		$this->helper			= $helper;
87
-		$this->request			= $request;
86
+		$this->helper = $helper;
87
+		$this->request = $request;
88 88
 		$this->auth				= $auth;
89
-		$this->pagination		= $pagination;
90
-		$this->captcha_factory 	= $captcha_factory;
89
+		$this->pagination = $pagination;
90
+		$this->captcha_factory = $captcha_factory;
91 91
 		$this->categorie		= $categorie;
92 92
 		$this->comment			= $comment;
93 93
 		$this->root_path		= $root_path;
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 		}
129 129
 
130 130
 		$sql = 'SELECT *
131
-			FROM ' . DIR_COMMENT_TABLE . '
131
+			FROM ' . DIR_COMMENT_TABLE.'
132 132
 			WHERE comment_id = ' . (int) $comment_id;
133 133
 		$result = $this->db->sql_query($sql);
134 134
 		$value = $this->db->sql_fetchrow($result);
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 			$meta_info = $this->helper->route('ernadoo_phpbbdirectory_comment_view_controller', array('link_id' => (int) $link_id));
146 146
 			meta_refresh(3, $meta_info);
147 147
 			$message = $this->language->lang('DIR_COMMENT_DELETE_OK');
148
-			$message = $message . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_COMMENT', '<a href="' . $meta_info . '">', '</a>');
148
+			$message = $message.'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_COMMENT', '<a href="'.$meta_info.'">', '</a>');
149 149
 			return $this->helper->message($message);
150 150
 		}
151 151
 		else
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 		$this->_check_comments_enable($link_id);
168 168
 
169 169
 		$sql = 'SELECT *
170
-			FROM ' . DIR_COMMENT_TABLE . '
170
+			FROM ' . DIR_COMMENT_TABLE.'
171 171
 			WHERE comment_id = ' . (int) $comment_id;
172 172
 		$result = $this->db->sql_query($sql);
173 173
 		$value = $this->db->sql_fetchrow($result);
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 		$comment_text = generate_text_for_edit($value['comment_text'], $value['comment_uid'], $value['comment_flags']);
181 181
 		$this->s_comment = $comment_text['text'];
182 182
 
183
-		$submit	= $this->request->is_set_post('update_comment') ? true : false;
183
+		$submit = $this->request->is_set_post('update_comment') ? true : false;
184 184
 
185 185
 		// If form is done
186 186
 		if ($submit)
@@ -236,15 +236,15 @@  discard block
 block discarded – undo
236 236
 		$this->_check_comments_enable($link_id);
237 237
 
238 238
 		$comment_id = $this->request->variable('c', 0);
239
-		$view 		= $this->request->variable('view', '');
240
-		$start 		= ($page - 1) * $this->config['dir_comments_per_page'];
239
+		$view = $this->request->variable('view', '');
240
+		$start = ($page - 1) * $this->config['dir_comments_per_page'];
241 241
 
242 242
 		$this->s_hidden_fields = array_merge($this->s_hidden_fields, array('page' => $page));
243 243
 
244 244
 		$this->_populate_form($link_id, $mode);
245 245
 
246 246
 		$sql = 'SELECT COUNT(comment_id) AS nb_comments
247
-			FROM ' . DIR_COMMENT_TABLE . '
247
+			FROM ' . DIR_COMMENT_TABLE.'
248 248
 			WHERE comment_link_id = ' . (int) $link_id;
249 249
 		$result = $this->db->sql_query($sql);
250 250
 		$nb_comments = (int) $this->db->sql_fetchfield('nb_comments');
@@ -264,10 +264,10 @@  discard block
 block discarded – undo
264 264
 					),
265 265
 					array(
266 266
 						'FROM'	=> array(ZEBRA_TABLE => 'z'),
267
-						'ON'	=> 'z.user_id = ' . $this->user->data['user_id'] . ' AND z.zebra_id = a.comment_user_id'
267
+						'ON'	=> 'z.user_id = '.$this->user->data['user_id'].' AND z.zebra_id = a.comment_user_id'
268 268
 					)
269 269
 			),
270
-			'WHERE'		=> 'a.comment_link_id = ' . (int) $link_id,
270
+			'WHERE'		=> 'a.comment_link_id = '.(int) $link_id,
271 271
 			'ORDER_BY'	=> 'a.comment_date DESC');
272 272
 		$sql = $this->db->sql_build_query('SELECT', $sql_array);
273 273
 		$result = $this->db->sql_query_limit($sql, $this->config['dir_comments_per_page'], $start);
@@ -296,12 +296,12 @@  discard block
 block discarded – undo
296 296
 				'S_COMMENT'			=> generate_text_for_display($comments['comment_text'], $comments['comment_uid'], $comments['comment_bitfield'], $comments['comment_flags']),
297 297
 				'S_ID'				=> $comments['comment_id'],
298 298
 
299
-				'U_EDIT'			=> ($edit_allowed) 		? $this->helper->route('ernadoo_phpbbdirectory_comment_edit_controller', array('link_id' => (int) $link_id, 'comment_id' => (int) $comments['comment_id'])) : '',
300
-				'U_DELETE'			=> ($delete_allowed) 	? $this->helper->route('ernadoo_phpbbdirectory_comment_delete_controller', array('link_id' => (int) $link_id, 'comment_id' => (int) $comments['comment_id'], '_referer' => $this->helper->get_current_url())) : '',
299
+				'U_EDIT'			=> ($edit_allowed) ? $this->helper->route('ernadoo_phpbbdirectory_comment_edit_controller', array('link_id' => (int) $link_id, 'comment_id' => (int) $comments['comment_id'])) : '',
300
+				'U_DELETE'			=> ($delete_allowed) ? $this->helper->route('ernadoo_phpbbdirectory_comment_delete_controller', array('link_id' => (int) $link_id, 'comment_id' => (int) $comments['comment_id'], '_referer' => $this->helper->get_current_url())) : '',
301 301
 
302 302
 				'S_IGNORE_POST'		=> ($comments['foe'] && ($view != 'show' || $comment_id != $comments['comment_id'])) ? true : false,
303 303
 				'L_IGNORE_POST'		=> ($comments['foe']) ? $this->language->lang('POST_BY_FOE', get_username_string('full', $comments['comment_user_id'], $comments['username'], $comments['user_colour']), '<a href="'.$this->helper->url('directory/link/'.$link_id.'/comment'.(($page > 1) ? '/'.$page : '').'?view=show#c'.(int) $comments['comment_id']).'">', '</a>') : '',
304
-				'L_POST_DISPLAY'	=> ($comments['foe']) ? $this->language->lang('POST_DISPLAY', '<a class="display_post" data-post-id="' . $comments['comment_id'] . '" href="' . $this->helper->url('directory/link/'.$link_id.'/comment'.(($page > 1) ? '/'.$page : '').'?c='.(int) $comments['comment_id'] . '&view=show#c'.(int) $comments['comment_id']).'">', '</a>') : '',
304
+				'L_POST_DISPLAY'	=> ($comments['foe']) ? $this->language->lang('POST_DISPLAY', '<a class="display_post" data-post-id="'.$comments['comment_id'].'" href="'.$this->helper->url('directory/link/'.$link_id.'/comment'.(($page > 1) ? '/'.$page : '').'?c='.(int) $comments['comment_id'].'&view=show#c'.(int) $comments['comment_id']).'">', '</a>') : '',
305 305
 
306 306
 				'S_INFO'			=> $this->auth->acl_get('m_info'),
307 307
 			));
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
 
342 342
 		if (!function_exists('validate_data'))
343 343
 		{
344
-			include($this->root_path . 'includes/functions_user.' . $this->php_ext);
344
+			include($this->root_path.'includes/functions_user.'.$this->php_ext);
345 345
 		}
346 346
 
347 347
 		$error = validate_data(
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 			$meta_info = $this->helper->route('ernadoo_phpbbdirectory_comment_view_controller', array('link_id' => (int) $link_id));
404 404
 			meta_refresh(3, $meta_info);
405 405
 			$message = $this->language->lang('DIR_'.strtoupper($mode).'_COMMENT_OK');
406
-			$message = $message . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_COMMENT', '<a href="' . $meta_info . '">', '</a>');
406
+			$message = $message.'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_COMMENT', '<a href="'.$meta_info.'">', '</a>');
407 407
 			return $this->helper->message($message);
408 408
 		}
409 409
 		else
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
 	private function _check_comments_enable($link_id)
427 427
 	{
428 428
 		$sql = 'SELECT link_cat
429
-			FROM ' . DIR_LINK_TABLE . '
429
+			FROM ' . DIR_LINK_TABLE.'
430 430
 			WHERE link_id = ' . (int) $link_id;
431 431
 		$result = $this->db->sql_query($sql);
432 432
 		$cat_id = (int) $this->db->sql_fetchfield('link_cat');
@@ -468,11 +468,11 @@  discard block
 block discarded – undo
468 468
 
469 469
 		if (!function_exists('generate_smilies'))
470 470
 		{
471
-			include($this->root_path . 'includes/functions_posting.' . $this->php_ext);
471
+			include($this->root_path.'includes/functions_posting.'.$this->php_ext);
472 472
 		}
473 473
 		if (!function_exists('display_custom_bbcodes'))
474 474
 		{
475
-			include($this->root_path . 'includes/functions_display.' . $this->php_ext);
475
+			include($this->root_path.'includes/functions_display.'.$this->php_ext);
476 476
 		}
477 477
 
478 478
 		generate_smilies('inline', 0);
@@ -482,11 +482,11 @@  discard block
 block discarded – undo
482 482
 		$this->template->assign_vars(array(
483 483
 			'S_AUTH_COMM' 		=> $this->auth->acl_get('u_comment_dir'),
484 484
 
485
-			'BBCODE_STATUS'		=> ($this->config['dir_allow_bbcode']) 	? $this->language->lang('BBCODE_IS_ON', '<a href="' . append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode') . '">', '</a>') : $this->language->lang('BBCODE_IS_OFF', '<a href="' . append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode') . '">', '</a>'),
486
-			'IMG_STATUS'		=> ($this->config['dir_allow_bbcode']) 	? $this->language->lang('IMAGES_ARE_ON') : $this->language->lang('IMAGES_ARE_OFF'),
487
-			'SMILIES_STATUS'	=> ($this->config['dir_allow_smilies'])	? $this->language->lang('SMILIES_ARE_ON') : $this->language->lang('SMILIES_ARE_OFF'),
488
-			'URL_STATUS'		=> ($this->config['dir_allow_links'])	? $this->language->lang('URL_IS_ON') : $this->language->lang('URL_IS_OFF'),
489
-			'FLASH_STATUS'		=> ($this->config['dir_allow_bbcode'] && $this->config['dir_allow_flash'])	? $this->language->lang('FLASH_IS_ON') : $this->language->lang('FLASH_IS_OFF'),
485
+			'BBCODE_STATUS'		=> ($this->config['dir_allow_bbcode']) ? $this->language->lang('BBCODE_IS_ON', '<a href="'.append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode').'">', '</a>') : $this->language->lang('BBCODE_IS_OFF', '<a href="'.append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode').'">', '</a>'),
486
+			'IMG_STATUS'		=> ($this->config['dir_allow_bbcode']) ? $this->language->lang('IMAGES_ARE_ON') : $this->language->lang('IMAGES_ARE_OFF'),
487
+			'SMILIES_STATUS'	=> ($this->config['dir_allow_smilies']) ? $this->language->lang('SMILIES_ARE_ON') : $this->language->lang('SMILIES_ARE_OFF'),
488
+			'URL_STATUS'		=> ($this->config['dir_allow_links']) ? $this->language->lang('URL_IS_ON') : $this->language->lang('URL_IS_OFF'),
489
+			'FLASH_STATUS'		=> ($this->config['dir_allow_bbcode'] && $this->config['dir_allow_flash']) ? $this->language->lang('FLASH_IS_ON') : $this->language->lang('FLASH_IS_OFF'),
490 490
 
491 491
 			'L_DIR_REPLY_EXP'	=> $this->language->lang('DIR_REPLY_EXP', $this->config['dir_length_comments']),
492 492
 
Please login to merge, or discard this patch.
controller/links.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -90,20 +90,20 @@  discard block
 block discarded – undo
90 90
 	*/
91 91
 	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\captcha\factory $captcha_factory, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link, \ernadoo\phpbbdirectory\core\helper $dir_helper, $root_path, $php_ext)
92 92
 	{
93
-		$this->db				= $db;
94
-		$this->config			= $config;
93
+		$this->db = $db;
94
+		$this->config = $config;
95 95
 		$this->language			= $language;
96 96
 		$this->template			= $template;
97 97
 		$this->user				= $user;
98
-		$this->helper			= $helper;
99
-		$this->request			= $request;
98
+		$this->helper = $helper;
99
+		$this->request = $request;
100 100
 		$this->auth				= $auth;
101
-		$this->captcha_factory 	= $captcha_factory;
101
+		$this->captcha_factory = $captcha_factory;
102 102
 		$this->categorie		= $categorie;
103 103
 		$this->link				= $link;
104
-		$this->dir_helper		= $dir_helper;
104
+		$this->dir_helper = $dir_helper;
105 105
 		$this->root_path		= $root_path;
106
-		$this->php_ext			= $php_ext;
106
+		$this->php_ext = $php_ext;
107 107
 
108 108
 		$language->add_lang('directory', 'ernadoo/phpbbdirectory');
109 109
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 		}
129 129
 
130 130
 		$sql = 'SELECT link_user_id
131
-			FROM ' . DIR_LINK_TABLE . '
131
+			FROM ' . DIR_LINK_TABLE.'
132 132
 			WHERE link_id = ' . (int) $link_id;
133 133
 		$result = $this->db->sql_query($sql);
134 134
 		$link_data = $this->db->sql_fetchrow($result);
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 
152 152
 			$meta_info = $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id));
153 153
 			meta_refresh(3, $meta_info);
154
-			$message = $this->language->lang('DIR_DELETE_OK') . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_DIR', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_base_controller') . '">', '</a>') . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id)) . '">', '</a>');
154
+			$message = $this->language->lang('DIR_DELETE_OK').'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_DIR', '<a href="'.$this->helper->route('ernadoo_phpbbdirectory_base_controller').'">', '</a>').'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id)).'">', '</a>');
155 155
 			return $this->helper->message($message);
156 156
 		}
157 157
 		else
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 	public function edit_link($cat_id, $link_id)
172 172
 	{
173 173
 		$sql = 'SELECT link_user_id
174
-			FROM ' . DIR_LINK_TABLE . '
174
+			FROM ' . DIR_LINK_TABLE.'
175 175
 			WHERE link_id = ' . (int) $link_id;
176 176
 		$result = $this->db->sql_query($sql);
177 177
 		$link_data = $this->db->sql_fetchrow($result);
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 		$cat_id		= $this->request->variable('id', $cat_id);
188 188
 		$submit		= $this->request->is_set_post('submit') ? true : false;
189 189
 		$refresh	= $this->request->is_set_post('refresh_vc') ? true : false;
190
-		$title		= $this->language->lang('DIR_EDIT_SITE');
190
+		$title = $this->language->lang('DIR_EDIT_SITE');
191 191
 
192 192
 		$this->template->assign_block_vars('dir_navlinks', array(
193 193
 			'FORUM_NAME'	=> $title,
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 		else
208 208
 		{
209 209
 			$sql = 'SELECT link_id, link_uid, link_flags, link_bitfield, link_cat, link_url, link_description, link_guest_email, link_name, link_rss, link_back, link_banner, link_flag, link_cat, link_time
210
-				FROM ' . DIR_LINK_TABLE . '
210
+				FROM ' . DIR_LINK_TABLE.'
211 211
 				WHERE link_id = ' . (int) $link_id;
212 212
 			$result = $this->db->sql_query($sql);
213 213
 
@@ -223,15 +223,15 @@  discard block
 block discarded – undo
223 223
 				'old_banner'	=> $site['link_banner'],
224 224
 			);
225 225
 
226
-			$site_description		= generate_text_for_edit($site['link_description'], $site['link_uid'], $site['link_flags']);
227
-			$site['link_banner'] 	= (preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $site['link_banner'])) ? $site['link_banner'] : '';
226
+			$site_description = generate_text_for_edit($site['link_description'], $site['link_uid'], $site['link_flags']);
227
+			$site['link_banner'] = (preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $site['link_banner'])) ? $site['link_banner'] : '';
228 228
 
229
-			$this->url			= $site['link_url'];
230
-			$this->site_name	= $site['link_name'];
229
+			$this->url = $site['link_url'];
230
+			$this->site_name = $site['link_name'];
231 231
 			$this->description	= $site_description['text'];
232 232
 			$this->guest_email	= $site['link_guest_email'];
233
-			$this->rss			= $site['link_rss'];
234
-			$this->banner 		= $site['link_banner'];
233
+			$this->rss = $site['link_rss'];
234
+			$this->banner = $site['link_banner'];
235 235
 			$this->back			= $site['link_back'];
236 236
 			$this->flag 		= $site['link_flag'];
237 237
 		}
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 		$cat_id		= $this->request->variable('id', $cat_id);
259 259
 		$submit		= $this->request->is_set_post('submit') ? true : false;
260 260
 		$refresh	= $this->request->is_set_post('refresh_vc') ? true : false;
261
-		$title		= $this->language->lang('DIR_NEW_SITE');
261
+		$title = $this->language->lang('DIR_NEW_SITE');
262 262
 
263 263
 		$this->template->assign_block_vars('dir_navlinks', array(
264 264
 			'FORUM_NAME'	=> $title,
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 
323 323
 		// We check if user had already vot for this website.
324 324
 		$sql = 'SELECT vote_link_id
325
-			FROM ' . DIR_VOTE_TABLE . '
325
+			FROM ' . DIR_VOTE_TABLE.'
326 326
 			WHERE ' . $this->db->sql_build_array('SELECT', $data);
327 327
 		$result = $this->db->sql_query($sql);
328 328
 		$data = $this->db->sql_fetchrow($result);
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
 
337 337
 		$meta_info = $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id));
338 338
 		meta_refresh(3, $meta_info);
339
-		$message = $this->language->lang('DIR_VOTE_OK') . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $meta_info . '">', '</a>');
339
+		$message = $this->language->lang('DIR_VOTE_OK').'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$meta_info.'">', '</a>');
340 340
 		return $this->helper->message($message);
341 341
 	}
342 342
 
@@ -361,18 +361,18 @@  discard block
 block discarded – undo
361 361
 			return $this->helper->message('FORM_INVALID');
362 362
 		}
363 363
 
364
-		$this->url			= $this->request->variable('url', '');
365
-		$this->site_name	= $this->request->variable('site_name', '', true);
364
+		$this->url = $this->request->variable('url', '');
365
+		$this->site_name = $this->request->variable('site_name', '', true);
366 366
 		$this->description	= $this->request->variable('description', '', true);
367 367
 		$this->guest_email	= $this->request->variable('guest_email', '');
368
-		$this->rss			= $this->request->variable('rss', '');
369
-		$this->banner 		= $this->request->variable('banner', '');
368
+		$this->rss = $this->request->variable('rss', '');
369
+		$this->banner = $this->request->variable('banner', '');
370 370
 		$this->back			= $this->request->variable('back', '');
371 371
 		$this->flag 		= $this->request->variable('flag', '');
372 372
 
373 373
 		if (!function_exists('validate_data'))
374 374
 		{
375
-			include($this->root_path . 'includes/functions_user.' . $this->php_ext);
375
+			include($this->root_path.'includes/functions_user.'.$this->php_ext);
376 376
 		}
377 377
 
378 378
 		// We define variables to check
@@ -395,17 +395,17 @@  discard block
 block discarded – undo
395 395
 			'site_name' =>			array(
396 396
 				array('string', false, 1, 100)),
397 397
 			'website'		=>		array(
398
-				array('string',	false, 12, 255),
399
-				array('match',	true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
398
+				array('string', false, 12, 255),
399
+				array('match', true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
400 400
 			'description'	=>		array(
401 401
 				array('string', !$this->categorie->data['cat_must_describe'], 1, $this->config['dir_length_describe'])),
402 402
 			'rss'			=>		array(
403 403
 				array('string', true, 12, 255),
404
-				array('match',	empty($this->rss), '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
404
+				array('match', empty($this->rss), '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
405 405
 			'banner'		=>		array(
406 406
 				array('string', true, 5, 255)),
407 407
 			'back'			=>		array(
408
-				array('string',	!$this->categorie->data['cat_link_back'], 12, 255),
408
+				array('string', !$this->categorie->data['cat_link_back'], 12, 255),
409 409
 				array(array($this->link, 'link_back'), true)),
410 410
 			'cat'			=>		array(
411 411
 				array('num', '', 1))
@@ -454,8 +454,8 @@  discard block
 block discarded – undo
454 454
 		// Still no errors?? So let's go!
455 455
 		if (!$error)
456 456
 		{
457
-			$this->banner	= (!$this->banner && !$this->request->is_set_post('delete_banner')) ? $this->request->variable('old_banner', '') : $this->banner;
458
-			$this->url		= $this->link->clean_url($this->url);
457
+			$this->banner = (!$this->banner && !$this->request->is_set_post('delete_banner')) ? $this->request->variable('old_banner', '') : $this->banner;
458
+			$this->url = $this->link->clean_url($this->url);
459 459
 
460 460
 			$data_edit = array(
461 461
 				'link_user_id'		=> $this->link_user_id,
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
 			$meta_info = $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id));
505 505
 			meta_refresh(3, $meta_info);
506 506
 			$message	= ($need_approval) ? $this->language->lang('DIR_'.strtoupper($mode).'_SITE_ACTIVE') : $this->language->lang('DIR_'.strtoupper($mode).'_SITE_OK');
507
-			$message	= $message . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_DIR', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_base_controller') . '">', '</a>') . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id)) . '">', '</a>');
507
+			$message	= $message.'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_DIR', '<a href="'.$this->helper->route('ernadoo_phpbbdirectory_base_controller').'">', '</a>').'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id)).'">', '</a>');
508 508
 			return $this->helper->message($message);
509 509
 		}
510 510
 		else
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
 	{
534 534
 		if (!function_exists('file_gc'))
535 535
 		{
536
-			include($this->root_path . 'includes/functions_download.' . $this->php_ext);
536
+			include($this->root_path.'includes/functions_download.'.$this->php_ext);
537 537
 		}
538 538
 
539 539
 		$file_path = $this->dir_helper->get_banner_path($banner_img);
@@ -588,7 +588,7 @@  discard block
 block discarded – undo
588 588
 
589 589
 		if (!function_exists('display_custom_bbcodes'))
590 590
 		{
591
-			include($this->root_path . 'includes/functions_display.' . $this->php_ext);
591
+			include($this->root_path.'includes/functions_display.'.$this->php_ext);
592 592
 		}
593 593
 		display_custom_bbcodes();
594 594
 		add_form_key('dir_form');
@@ -597,17 +597,17 @@  discard block
 block discarded – undo
597 597
 		$flag_path = $ext_path.'images/flags/';
598 598
 
599 599
 		$s_guest	= (!$this->user->data['is_registered'] || !empty($this->guest_email));
600
-		$s_rss		= $this->config['dir_activ_rss'];
601
-		$s_banner	= $this->config['dir_activ_banner'];
600
+		$s_rss = $this->config['dir_activ_rss'];
601
+		$s_banner = $this->config['dir_activ_banner'];
602 602
 		$s_back		= $this->categorie->data['cat_link_back'];
603 603
 		$s_flag		= $this->config['dir_activ_flag'];
604 604
 
605 605
 		$this->template->assign_vars(array(
606
-			'BBCODE_STATUS'			=> ($this->config['allow_bbcode']) 	? $this->language->lang('BBCODE_IS_ON', '<a href="' . append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode') . '">', '</a>') : $this->language->lang('BBCODE_IS_OFF', '<a href="' . append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode') . '">', '</a>'),
607
-			'IMG_STATUS'			=> ($this->config['allow_bbcode'])	? $this->language->lang('IMAGES_ARE_ON') : $this->language->lang('IMAGES_ARE_OFF'),
606
+			'BBCODE_STATUS'			=> ($this->config['allow_bbcode']) ? $this->language->lang('BBCODE_IS_ON', '<a href="'.append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode').'">', '</a>') : $this->language->lang('BBCODE_IS_OFF', '<a href="'.append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode').'">', '</a>'),
607
+			'IMG_STATUS'			=> ($this->config['allow_bbcode']) ? $this->language->lang('IMAGES_ARE_ON') : $this->language->lang('IMAGES_ARE_OFF'),
608 608
 			'SMILIES_STATUS'		=> ($this->config['allow_smilies']) ? $this->language->lang('SMILIES_ARE_ON') : $this->language->lang('SMILIES_ARE_OFF'),
609 609
 			'URL_STATUS'			=> ($this->config['allow_post_links']) ? $this->language->lang('URL_IS_ON') : $this->language->lang('URL_IS_OFF'),
610
-			'FLASH_STATUS'			=> ($this->config['allow_bbcode'] && $this->config['allow_post_flash'])	? $this->language->lang('FLASH_IS_ON') : $this->language->lang('FLASH_IS_OFF'),
610
+			'FLASH_STATUS'			=> ($this->config['allow_bbcode'] && $this->config['allow_post_flash']) ? $this->language->lang('FLASH_IS_ON') : $this->language->lang('FLASH_IS_OFF'),
611 611
 
612 612
 			'L_TITLE'				=> $title,
613 613
 			'L_DIR_DESCRIPTION_EXP'	=> $this->language->lang('DIR_DESCRIPTION_EXP', $this->config['dir_length_describe']),
Please login to merge, or discard this patch.