Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 9 commits
  • 5 files changed
  • 0 comments
  • 3 contributors
10  include/classes/lang.php
@@ -23,14 +23,14 @@ class Flux_Lang
23 23
 	 *
24 24
 	 * @var string
25 25
 	 */
26  
-	protected $defaultLang = 'en';
  26
+	protected $defaultLang = 'English';
27 27
 
28 28
 	/**
29 29
 	 * The language to use
30 30
 	 *
31 31
 	 * @var string
32 32
 	 */
33  
-	protected $lang = 'en';
  33
+	protected $lang = 'English';
34 34
 
35 35
 	/**
36 36
 	 * The resources that have been loaded so far
@@ -38,11 +38,11 @@ class Flux_Lang
38 38
 	 * @var array
39 39
 	 */
40 40
 	protected $loadedResources = array();
41  
-	
42  
-	
  41
+
  42
+
43 43
 	/**
44 44
 	 * Constructor
45  
-	 * 
  45
+	 *
46 46
 	 * @param string $lang
47 47
 	 */
48 48
 	public function __construct($lang)
12  include/functions.php
@@ -527,7 +527,7 @@ function check_bans()
527 527
 //
528 528
 function check_username($username, $exclude_id = null)
529 529
 {
530  
-	global $db, $pun_config, $errors, $lang, $lang, $pun_bans;
  530
+	global $db, $pun_config, $errors, $lang, $pun_bans;
531 531
 
532 532
 	$lang->load('prof_reg');
533 533
 	$lang->load('register');
@@ -771,7 +771,7 @@ function get_tracked_topics()
771 771
 	if (!$cookie_data)
772 772
 		return array('topics' => array(), 'forums' => array());
773 773
 
774  
-	if (strlen($cookie_data) > 4048)
  774
+	if (strlen($cookie_data) > FORUM_MAX_COOKIE_SIZE)
775 775
 		return array('topics' => array(), 'forums' => array());
776 776
 
777 777
 	// Unserialize data from cookie
@@ -1851,7 +1851,7 @@ function file_size($size)
1851 1851
 	for ($i = 0; $size > 1024; $i++)
1852 1852
 		$size /= 1024;
1853 1853
 
1854  
-	return $lang->t('Size unit '.$units[$i], round($size, 2));;
  1854
+	return $lang->t('Size unit '.$units[$i], round($size, 2));
1855 1855
 }
1856 1856
 
1857 1857
 
@@ -2126,13 +2126,13 @@ function ucp_preg_replace($pattern, $replace, $subject)
2126 2126
 //
2127 2127
 // As MySQL cannot properly handle four-byte characters with the default utf-8
2128 2128
 // charset up until version 5.5.3 (where a special charset has to be used), they
2129  
-// need to be replaced, by question marks in this case. 
  2129
+// need to be replaced, by question marks in this case.
2130 2130
 //
2131 2131
 function strip_bad_multibyte_chars($str)
2132 2132
 {
2133 2133
 	$result = '';
2134 2134
 	$length = strlen($str);
2135  
-	
  2135
+
2136 2136
 	for ($i = 0; $i < $length; $i++)
2137 2137
 	{
2138 2138
 		// Replace four-byte characters (11110www 10zzzzzz 10yyyyyy 10xxxxxx)
@@ -2147,7 +2147,7 @@ function strip_bad_multibyte_chars($str)
2147 2147
 			$result .= $str[$i];
2148 2148
 		}
2149 2149
 	}
2150  
-	
  2150
+
2151 2151
 	return $result;
2152 2152
 }
2153 2153
 
5  include/search_idx.php
@@ -47,6 +47,9 @@
47 47
 //
48 48
 function split_words($text, $idx)
49 49
 {
  50
+	// Remove BBCode
  51
+	$text = preg_replace('%\[/?(b|u|s|ins|del|em|i|h|colou?r|quote|code|img|url|email|list|topic|post|forum|user)(?:\=[^\]]*)?\]%', ' ', $text);
  52
+
50 53
 	// Remove any apostrophes or dashes which aren't part of words
51 54
 	$text = substr(ucp_preg_replace('%((?<=[^\p{L}\p{N}])[\'\-]|[\'\-](?=[^\p{L}\p{N}]))%u', '', ' '.$text.' '), 1, -1);
52 55
 
@@ -158,8 +161,8 @@ function strip_bbcode($text)
158 161
 		$patterns = array(
159 162
 			'%\[img=([^\]]*+)\]([^[]*+)\[/img\]%'									=>	'$2 $1',	// Keep the url and description
160 163
 			'%\[(url|email)=([^\]]*+)\]([^[]*+(?:(?!\[/\1\])\[[^[]*+)*)\[/\1\]%'	=>	'$2 $3',	// Keep the url and text
  164
+			'%\[(img|url|email)\]([^[]*+(?:(?!\[/\1\])\[[^[]*+)*)\[/\1\]%'			=>	'$2',		// Keep the url
161 165
 			'%\[(topic|post|forum|user)\][1-9]\d*\[/\1\]%'							=>	' ',		// Do not index topic/post/forum/user ID
162  
-			'%\[/?(b|u|s|ins|del|em|i|h|colou?r|quote|code|img|url|email|list|topic|post|forum|user)(?:\=[^\]]*)?\]%'	=> ' ' // Remove BBCode
163 166
 		);
164 167
 	}
165 168
 
4  install.php
@@ -84,11 +84,9 @@ function stripslashes_array($array)
84 84
 
85 85
 // Load the language system
86 86
 require PUN_ROOT.'include/classes/lang.php';
87  
-$lang = new Flux_Lang();
88  
-
89 87
 // If we've been passed a default language, use it
90 88
 $install_lang = isset($_REQUEST['install_lang']) ? trim($_REQUEST['install_lang']) : 'English';
91  
-$lang->setLanguage($install_lang);
  89
+$lang = new Flux_Lang($install_lang);
92 90
 
93 91
 // Load the install.php language file
94 92
 $lang->load('install');
8  misc.php
@@ -163,11 +163,19 @@
163 163
 		if (strpos($referrer['host'], 'www.') === 0)
164 164
 			$referrer['host'] = substr($referrer['host'], 4);
165 165
 
  166
+		// Make sure the path component exists
  167
+		if (!isset($referrer['path']))
  168
+			$referrer['path'] = '';
  169
+
166 170
 		$valid = parse_url(get_base_url());
167 171
 		// Remove www subdomain if it exists
168 172
 		if (strpos($valid['host'], 'www.') === 0)
169 173
 			$valid['host'] = substr($valid['host'], 4);
170 174
 
  175
+		// Make sure the path component exists
  176
+		if (!isset($valid['path']))
  177
+			$valid['path'] = '';
  178
+
171 179
 		if ($referrer['host'] == $valid['host'] && preg_match('%^'.preg_quote($valid['path'], '%').'/(.*?)\.php%i', $referrer['path']))
172 180
 			$redirect_url = $_SERVER['HTTP_REFERER'];
173 181
 	}

No commit comments for this range

Something went wrong with that request. Please try again.