Ver código fonte

Some more

tags/3.6
Michael 1 ano atrás
pai
commit
5a6fa4ae87
5 arquivos alterados com 22 adições e 36 exclusões
  1. 2
    2
      include/auth_ejabberd.php
  2. 1
    4
      mod/admin.php
  3. 1
    2
      mod/cal.php
  4. 7
    17
      mod/settings.php
  5. 11
    11
      src/ParseUrl.php

+ 2
- 2
include/auth_ejabberd.php Ver arquivo

@@ -79,7 +79,7 @@ class exAuth {
79 79
 		$this->writeLog(LOG_NOTICE, "start");
80 80
 
81 81
 		// We are connected to the SQL server.
82
-		do {
82
+		while (!feof(STDIN)) {
83 83
 			// Quit if the database connection went down
84 84
 			if (!dba::connected()) {
85 85
 				$this->writeLog(LOG_ERR, "the database connection went down");
@@ -125,7 +125,7 @@ class exAuth {
125 125
 				$this->writeLog(LOG_NOTICE, "invalid command string ".$sData);
126 126
 				fwrite(STDOUT, pack("nn", 2, 0));
127 127
 			}
128
-		} while (true);
128
+		}
129 129
 	}
130 130
 
131 131
 	/**

+ 1
- 4
mod/admin.php Ver arquivo

@@ -2273,10 +2273,7 @@ function admin_page_features(App $a) {
2273 2273
 			$arr[$fname][0] = $fdata[0];
2274 2274
 			foreach (array_slice($fdata,1) as $f) {
2275 2275
 
2276
-				$set = Config::get('feature',$f[0]);
2277
-				if ($set === false) {
2278
-					$set = $f[3];
2279
-				}
2276
+				$set = Config::get('feature',$f[0], $f[3]);
2280 2277
 				$arr[$fname][1][] = array(
2281 2278
 					array('feature_' .$f[0],$f[1],$set,$f[2],array(t('Off'), t('On'))),
2282 2279
 					array('featurelock_' .$f[0],sprintf(t('Lock feature %s'),$f[1]),(($f[4] !== false) ? "1" : ''),'',array(t('Off'), t('On')))

+ 1
- 2
mod/cal.php Ver arquivo

@@ -73,8 +73,7 @@ function cal_content(App $a) {
73 73
 	nav_set_selected('events');
74 74
 
75 75
 	// First day of the week (0 = Sunday)
76
-	$firstDay = PConfig::get(local_user(),'system','first_day_of_week');
77
-	if ($firstDay === false) $firstDay=0;
76
+	$firstDay = PConfig::get(local_user(),'system','first_day_of_week', 0);
78 77
 
79 78
 	// get the translation strings for the callendar
80 79
 	$i18n = get_event_strings();

+ 7
- 17
mod/settings.php Ver arquivo

@@ -953,7 +953,7 @@ function settings_content(App $a) {
953 953
 				$is_experimental = file_exists('view/theme/' . $th . '/experimental');
954 954
 				$unsupported = file_exists('view/theme/' . $th . '/unsupported');
955 955
 				$is_mobile = file_exists('view/theme/' . $th . '/mobile');
956
-				if (!$is_experimental || ($is_experimental && (Config::get('experimentals', 'exp_themes')==1 || Config::get('experimentals', 'exp_themes')===false))) {
956
+				if (!$is_experimental || ($is_experimental && (Config::get('experimentals', 'exp_themes')==1 || is_null(Config::get('experimentals', 'exp_themes'))))) {
957 957
 					$theme_name = (($is_experimental) ?  sprintf("%s - \x28Experimental\x29", $f) : $f);
958 958
 					if ($is_mobile) {
959 959
 						$mobile_themes[$f]=$theme_name;
@@ -978,24 +978,14 @@ function settings_content(App $a) {
978 978
 		$itemspage_mobile_network = intval(PConfig::get(local_user(), 'system', 'itemspage_mobile_network'));
979 979
 		$itemspage_mobile_network = (($itemspage_mobile_network > 0 && $itemspage_mobile_network < 101) ? $itemspage_mobile_network : 20); // default if not set: 20 items
980 980
 
981
-		$nosmile = PConfig::get(local_user(), 'system', 'no_smilies');
982
-		$nosmile = (($nosmile===false)? '0': $nosmile); // default if not set: 0
983
-
984
-		$first_day_of_week = PConfig::get(local_user(), 'system', 'first_day_of_week');
985
-		$first_day_of_week = (($first_day_of_week===false)? '0': $first_day_of_week); // default if not set: 0
981
+		$nosmile = PConfig::get(local_user(), 'system', 'no_smilies', 0);
982
+		$first_day_of_week = PConfig::get(local_user(), 'system', 'first_day_of_week', 0);
986 983
 		$weekdays = array(0 => t("Sunday"), 1 => t("Monday"));
987 984
 
988
-		$noinfo = PConfig::get(local_user(), 'system', 'ignore_info');
989
-		$noinfo = (($noinfo===false)? '0': $noinfo); // default if not set: 0
990
-
991
-		$infinite_scroll = PConfig::get(local_user(), 'system', 'infinite_scroll');
992
-		$infinite_scroll = (($infinite_scroll===false)? '0': $infinite_scroll); // default if not set: 0
993
-
994
-		$no_auto_update = PConfig::get(local_user(), 'system', 'no_auto_update');
995
-		$no_auto_update = (($no_auto_update===false)? '0': $no_auto_update); // default if not set: 0
996
-
997
-		$bandwidth_saver = PConfig::get(local_user(), 'system', 'bandwidth_saver');
998
-		$bandwidth_saver = (($bandwidth_saver === false) ? '0' : $bandwidth_saver); // default if not set: 0
985
+		$noinfo = PConfig::get(local_user(), 'system', 'ignore_info', 0);
986
+		$infinite_scroll = PConfig::get(local_user(), 'system', 'infinite_scroll', 0);
987
+		$no_auto_update = PConfig::get(local_user(), 'system', 'no_auto_update', 0);
988
+		$bandwidth_saver = PConfig::get(local_user(), 'system', 'bandwidth_saver', 0);
999 989
 
1000 990
 		$theme_config = "";
1001 991
 		if (($themeconfigfile = get_theme_config_file($theme_selected)) != null) {

+ 11
- 11
src/ParseUrl.php Ver arquivo

@@ -161,13 +161,13 @@ class ParseUrl {
161 161
 
162 162
 			$oembed_data = oembed_fetch_url($url);
163 163
 
164
-			if (!in_array($oembed_data->type, array("error", "rich"))) {
164
+			if (!in_array($oembed_data->type, array("error", "rich", ""))) {
165 165
 				$siteinfo["type"] = $oembed_data->type;
166 166
 			}
167 167
 
168 168
 			if (($oembed_data->type == "link") && ($siteinfo["type"] != "photo")) {
169 169
 				if (isset($oembed_data->title)) {
170
-					$siteinfo["title"] = $oembed_data->title;
170
+					$siteinfo["title"] = trim($oembed_data->title);
171 171
 				}
172 172
 				if (isset($oembed_data->description)) {
173 173
 					$siteinfo["text"] = trim($oembed_data->description);
@@ -240,7 +240,7 @@ class ParseUrl {
240 240
 
241 241
 		$list = $xpath->query("//title");
242 242
 		if ($list->length > 0) {
243
-			$siteinfo["title"] = $list->item(0)->nodeValue;
243
+			$siteinfo["title"] = trim($list->item(0)->nodeValue);
244 244
 		}
245 245
 
246 246
 		//$list = $xpath->query("head/meta[@name]");
@@ -258,10 +258,10 @@ class ParseUrl {
258 258
 			if ($attr["content"] != "") {
259 259
 				switch (strtolower($attr["name"])) {
260 260
 					case "fulltitle":
261
-						$siteinfo["title"] = $attr["content"];
261
+						$siteinfo["title"] = trim($attr["content"]);
262 262
 						break;
263 263
 					case "description":
264
-						$siteinfo["text"] = $attr["content"];
264
+						$siteinfo["text"] = trim($attr["content"]);
265 265
 						break;
266 266
 					case "thumbnail":
267 267
 						$siteinfo["image"] = $attr["content"];
@@ -278,16 +278,16 @@ class ParseUrl {
278 278
 						}
279 279
 						break;
280 280
 					case "twitter:description":
281
-						$siteinfo["text"] = $attr["content"];
281
+						$siteinfo["text"] = trim($attr["content"]);
282 282
 						break;
283 283
 					case "twitter:title":
284
-						$siteinfo["title"] = $attr["content"];
284
+						$siteinfo["title"] = trim($attr["content"]);
285 285
 						break;
286 286
 					case "dc.title":
287
-						$siteinfo["title"] = $attr["content"];
287
+						$siteinfo["title"] = trim($attr["content"]);
288 288
 						break;
289 289
 					case "dc.description":
290
-						$siteinfo["text"] = $attr["content"];
290
+						$siteinfo["text"] = trim($attr["content"]);
291 291
 						break;
292 292
 					case "keywords":
293 293
 						$keywords = explode(",", $attr["content"]);
@@ -329,10 +329,10 @@ class ParseUrl {
329 329
 						$siteinfo["image"] = $attr["content"];
330 330
 						break;
331 331
 					case "og:title":
332
-						$siteinfo["title"] = $attr["content"];
332
+						$siteinfo["title"] = trim($attr["content"]);
333 333
 						break;
334 334
 					case "og:description":
335
-						$siteinfo["text"] = $attr["content"];
335
+						$siteinfo["text"] = trim($attr["content"]);
336 336
 						break;
337 337
 				}
338 338
 			}

Carregando…
Cancelar
Salvar