www/adiumxtras.com 43:f8c2a22f117d: Add support for getting a li...

commits at adium.im commits at adium.im
Thu Jan 10 19:08:17 UTC 2013


details:	http://hg.adium.im/www/adiumxtras.com/rev/f8c2a22f117d
revision:	43:f8c2a22f117d
branch:		adiumxtras.com
author:		Frank Dowsett <wixardy at gmail.com>
date:		Thu Jan 10 13:27:23 2013 -0500

Add support for getting a list of xtras' current versions from a comma separated list. Fixes #13180

diffs (32 lines):

diff -r 4833d43f8daf -r f8c2a22f117d xtras.php
--- a/xtras.php	Sat Mar 03 21:02:40 2012 +0100
+++ b/xtras.php	Thu Jan 10 13:27:23 2013 -0500
@@ -38,6 +38,28 @@
 			header(sprintf("Location: %s", $_SERVER['HTTP_REFERER']));
 		break;
 
+		case "version":
+			$xtrasList = $_GET['xtra_ids'];
+			$xtrasList = explode(",", $xtrasList);
+			if (count($xtrasList) > 1) {
+				//Remove non-numeric values
+				foreach ($xtrasList as $key => $value) {
+					if (!is_numeric($value))
+						unset($xtrasList[$key]);
+				}
+				$xtras = implode(",", $xtrasList);
+			} else
+				$xtras = intval($xtrasList[0]);
+
+			if ($xtras) {
+				$sql->query("SELECT xtra_id, version FROM xtras WHERE xtras.xtra_id in ({$xtras})");
+				$rows = array();
+				while($row = $sql->fetch_assoc())
+					$rows[] = $row;
+				echo json_encode($rows, JSON_NUMERIC_CHECK);
+			}
+		break;
+
 		case "add_comment":
             require_once('../recaptcha_keys.php');
 			require_once('recaptchalib.php');




More information about the commits mailing list