Authored by whb

添加格式转换

@@ -402,7 +402,7 @@ class WebAction extends Controller_Abstract @@ -402,7 +402,7 @@ class WebAction extends Controller_Abstract
402 if (!$this->_useSession) { 402 if (!$this->_useSession) {
403 $useSession = false; 403 $useSession = false;
404 } 404 }
405 - $useSession = false; 405 + //$useSession = false;
406 406
407 if (!$this->_uid) { 407 if (!$this->_uid) {
408 $cookie = $this->getCookie('_UID'); 408 $cookie = $this->getCookie('_UID');
@@ -95,7 +95,7 @@ class InfoData @@ -95,7 +95,7 @@ class InfoData
95 */ 95 */
96 public static function getArticleInfo($id, $onlyUrl = false) 96 public static function getArticleInfo($id, $onlyUrl = false)
97 { 97 {
98 - $param['article_id'] = $id; 98 + $param['article_id'] = intval($id);
99 return self::webApi(self::getUrl('getArticle'), $param, $onlyUrl); 99 return self::webApi(self::getUrl('getArticle'), $param, $onlyUrl);
100 } 100 }
101 101
@@ -107,7 +107,7 @@ class InfoData @@ -107,7 +107,7 @@ class InfoData
107 */ 107 */
108 public static function author($authorId, $onlyUrl = false) 108 public static function author($authorId, $onlyUrl = false)
109 { 109 {
110 - $param['author_id'] = $authorId; 110 + $param['author_id'] = intval($authorId);
111 return self::webApi(self::getUrl('author'), $param, $onlyUrl); 111 return self::webApi(self::getUrl('author'), $param, $onlyUrl);
112 } 112 }
113 113
@@ -121,8 +121,8 @@ class InfoData @@ -121,8 +121,8 @@ class InfoData
121 121
122 public static function tagTop($page = 1,$limit = 10, $onlyUrl = false) 122 public static function tagTop($page = 1,$limit = 10, $onlyUrl = false)
123 { 123 {
124 - $param['page'] = $page;  
125 - $param['limit'] = $limit; 124 + $param['page'] = intval($page);
  125 + $param['limit'] = intval($limit);
126 return self::webApi(self::getUrl('getTagTop'), $param, $onlyUrl); 126 return self::webApi(self::getUrl('getTagTop'), $param, $onlyUrl);
127 } 127 }
128 128
@@ -136,9 +136,9 @@ class InfoData @@ -136,9 +136,9 @@ class InfoData
136 */ 136 */
137 public static function comment($articleId, $page = 1, $limit = 10, $onlyUrl = false) 137 public static function comment($articleId, $page = 1, $limit = 10, $onlyUrl = false)
138 { 138 {
139 - $param['article_id'] = $articleId;  
140 - $param['page'] = $page;  
141 - $param['limit'] = $limit; 139 + $param['article_id'] = intval($articleId);
  140 + $param['page'] = intval($page);
  141 + $param['limit'] = intval($limit);
142 return self::webApi(self::getUrl('commentList'), $param, $onlyUrl); 142 return self::webApi(self::getUrl('commentList'), $param, $onlyUrl);
143 } 143 }
144 144
@@ -150,7 +150,7 @@ class InfoData @@ -150,7 +150,7 @@ class InfoData
150 */ 150 */
151 public static function articleContent($articleId, $onlyUrl = false) 151 public static function articleContent($articleId, $onlyUrl = false)
152 { 152 {
153 - $param['article_id'] = $articleId; 153 + $param['article_id'] = intval($articleId);
154 return self::webApi(self::getUrl('getArticleContent'), $param, $onlyUrl); 154 return self::webApi(self::getUrl('getArticleContent'), $param, $onlyUrl);
155 } 155 }
156 156
@@ -164,7 +164,7 @@ class InfoData @@ -164,7 +164,7 @@ class InfoData
164 */ 164 */
165 public static function baseInfo($articleId, $uid, $udid, $onlyUrl = false) 165 public static function baseInfo($articleId, $uid, $udid, $onlyUrl = false)
166 { 166 {
167 - $param['id'] = $articleId; 167 + $param['id'] = intval($articleId);
168 $param['uid'] = $uid; 168 $param['uid'] = $uid;
169 $param['udid'] = $udid; 169 $param['udid'] = $udid;
170 return self::webApi(self::getUrl('getArticleBaseInfo'), $param, $onlyUrl); 170 return self::webApi(self::getUrl('getArticleBaseInfo'), $param, $onlyUrl);
@@ -178,7 +178,7 @@ class InfoData @@ -178,7 +178,7 @@ class InfoData
178 */ 178 */
179 public static function relateBrand($articleId, $onlyUrl = false) 179 public static function relateBrand($articleId, $onlyUrl = false)
180 { 180 {
181 - $param['article_id'] = $articleId; 181 + $param['article_id'] = intval($articleId);
182 return self::webApi(self::getUrl('getBrand'), $param, $onlyUrl); 182 return self::webApi(self::getUrl('getBrand'), $param, $onlyUrl);
183 } 183 }
184 184
@@ -192,9 +192,9 @@ class InfoData @@ -192,9 +192,9 @@ class InfoData
192 */ 192 */
193 public static function relateList($articleId, $tag, $limit = 3, $onlyUrl = false) 193 public static function relateList($articleId, $tag, $limit = 3, $onlyUrl = false)
194 { 194 {
195 - $param['article_id'] = $articleId; 195 + $param['article_id'] = intval($articleId);
196 $param['tags'] = $tag; 196 $param['tags'] = $tag;
197 - $param['limit'] = $limit; 197 + $param['limit'] = intval($limit);
198 return self::webApi(self::getUrl('getOtherArticle'), $param, $onlyUrl); 198 return self::webApi(self::getUrl('getOtherArticle'), $param, $onlyUrl);
199 } 199 }
200 200
@@ -210,8 +210,8 @@ class InfoData @@ -210,8 +210,8 @@ class InfoData
210 public static function recommend($gender, $page = 1, $limit = 10, $onlyUrl = false) 210 public static function recommend($gender, $page = 1, $limit = 10, $onlyUrl = false)
211 { 211 {
212 $param['gender'] = $gender; 212 $param['gender'] = $gender;
213 - $param['page'] = $page;  
214 - $param['limit'] = $limit; 213 + $param['page'] = intval($page);
  214 + $param['limit'] = intval($limit);
215 return self::webApi(self::getUrl('getArticleByViewsNum'), $param, $onlyUrl); 215 return self::webApi(self::getUrl('getArticleByViewsNum'), $param, $onlyUrl);
216 } 216 }
217 217
@@ -224,7 +224,7 @@ class InfoData @@ -224,7 +224,7 @@ class InfoData
224 */ 224 */
225 public static function addComment($id, $uid, $content) 225 public static function addComment($id, $uid, $content)
226 { 226 {
227 - $param['article_id'] = $id; 227 + $param['article_id'] = intval($id);
228 $param['uid'] = $uid; 228 $param['uid'] = $uid;
229 $param['content'] = $content; 229 $param['content'] = $content;
230 return self::webApi(self::getUrl('addComment'), $param); 230 return self::webApi(self::getUrl('addComment'), $param);
@@ -238,7 +238,7 @@ class InfoData @@ -238,7 +238,7 @@ class InfoData
238 */ 238 */
239 public static function setPraise($id, $udid) 239 public static function setPraise($id, $udid)
240 { 240 {
241 - $param['article_id'] = $id; 241 + $param['article_id'] = intval($id);
242 $param['udid'] = $udid; 242 $param['udid'] = $udid;
243 return self::webApi(self::getUrl('setPraise'), $param); 243 return self::webApi(self::getUrl('setPraise'), $param);
244 } 244 }
@@ -251,7 +251,7 @@ class InfoData @@ -251,7 +251,7 @@ class InfoData
251 */ 251 */
252 public static function cancelPraise($id, $udid) 252 public static function cancelPraise($id, $udid)
253 { 253 {
254 - $param['article_id'] = $id; 254 + $param['article_id'] = intval($id);
255 $param['udid'] = $udid; 255 $param['udid'] = $udid;
256 return self::webApi(self::getUrl('cancelPraise'), $param); 256 return self::webApi(self::getUrl('cancelPraise'), $param);
257 } 257 }
@@ -264,7 +264,7 @@ class InfoData @@ -264,7 +264,7 @@ class InfoData
264 */ 264 */
265 public static function setFavorite($id, $uid) 265 public static function setFavorite($id, $uid)
266 { 266 {
267 - $param['article_id'] = $id; 267 + $param['article_id'] = intval($id);
268 $param['uid'] = $uid; 268 $param['uid'] = $uid;
269 return self::webApi(self::getUrl('setFavorite'), $param); 269 return self::webApi(self::getUrl('setFavorite'), $param);
270 } 270 }
@@ -277,7 +277,7 @@ class InfoData @@ -277,7 +277,7 @@ class InfoData
277 */ 277 */
278 public static function cancelFavorite($id, $uid) 278 public static function cancelFavorite($id, $uid)
279 { 279 {
280 - $param['article_id'] = $id; 280 + $param['article_id'] = intval($id);
281 $param['uid'] = $uid; 281 $param['uid'] = $uid;
282 return self::webApi(self::getUrl('cancelFavorite'), $param); 282 return self::webApi(self::getUrl('cancelFavorite'), $param);
283 } 283 }