@@ -208,9 +208,9 @@ function blogger_getPost($args) {
208208
209209 $ this ->escape ($ args );
210210
211- $ post_ID = $ args [1 ];
212- $ user_login = $ args [2 ];
213- $ user_pass = $ args [3 ];
211+ $ post_ID = ( int ) $ args [1 ];
212+ $ user_login = $ args [2 ];
213+ $ user_pass = $ args [3 ];
214214
215215 if (!$ this ->login_pass_ok ($ user_login , $ user_pass )) {
216216 return $ this ->error ;
@@ -243,10 +243,10 @@ function blogger_getRecentPosts($args) {
243243
244244 $ this ->escape ($ args );
245245
246- $ blog_ID = $ args [1 ]; /* though we don't use it yet */
247- $ user_login = $ args [2 ];
248- $ user_pass = $ args [3 ];
249- $ num_posts = $ args [4 ];
246+ $ blog_ID = ( int ) $ args [1 ]; /* though we don't use it yet */
247+ $ user_login = $ args [2 ];
248+ $ user_pass = $ args [3 ];
249+ $ num_posts = $ args [4 ];
250250
251251 if (!$ this ->login_pass_ok ($ user_login , $ user_pass )) {
252252 return $ this ->error ;
@@ -291,7 +291,7 @@ function blogger_getTemplate($args) {
291291
292292 $ this ->escape ($ args );
293293
294- $ blog_ID = $ args [1 ];
294+ $ blog_ID = ( int ) $ args [1 ];
295295 $ user_login = $ args [2 ];
296296 $ user_pass = $ args [3 ];
297297 $ template = $ args [4 ]; /* could be 'main' or 'archiveIndex', but we don't use it */
@@ -325,7 +325,7 @@ function blogger_setTemplate($args) {
325325
326326 $ this ->escape ($ args );
327327
328- $ blog_ID = $ args [1 ];
328+ $ blog_ID = ( int ) $ args [1 ];
329329 $ user_login = $ args [2 ];
330330 $ user_pass = $ args [3 ];
331331 $ content = $ args [4 ];
@@ -362,7 +362,7 @@ function blogger_newPost($args) {
362362
363363 $ this ->escape ($ args );
364364
365- $ blog_ID = $ args [1 ]; /* though we don't use it yet */
365+ $ blog_ID = ( int ) $ args [1 ]; /* though we don't use it yet */
366366 $ user_login = $ args [2 ];
367367 $ user_pass = $ args [3 ];
368368 $ content = $ args [4 ];
@@ -459,7 +459,7 @@ function blogger_deletePost($args) {
459459
460460 $ this ->escape ($ args );
461461
462- $ post_ID = $ args [1 ];
462+ $ post_ID = ( int ) $ args [1 ];
463463 $ user_login = $ args [2 ];
464464 $ user_pass = $ args [3 ];
465465 $ publish = $ args [4 ];
@@ -500,7 +500,7 @@ function mw_newPost($args) {
500500
501501 $ this ->escape ($ args );
502502
503- $ blog_ID = $ args [0 ]; // we will support this in the near future
503+ $ blog_ID = ( int ) $ args [0 ]; // we will support this in the near future
504504 $ user_login = $ args [1 ];
505505 $ user_pass = $ args [2 ];
506506 $ content_struct = $ args [3 ];
@@ -668,7 +668,7 @@ function mw_getPost($args) {
668668
669669 $ this ->escape ($ args );
670670
671- $ post_ID = $ args [0 ];
671+ $ post_ID = ( int ) $ args [0 ];
672672 $ user_login = $ args [1 ];
673673 $ user_pass = $ args [2 ];
674674
@@ -723,10 +723,10 @@ function mw_getRecentPosts($args) {
723723
724724 $ this ->escape ($ args );
725725
726- $ blog_ID = $ args [0 ];
727- $ user_login = $ args [1 ];
728- $ user_pass = $ args [2 ];
729- $ num_posts = $ args [3 ];
726+ $ blog_ID = ( int ) $ args [0 ];
727+ $ user_login = $ args [1 ];
728+ $ user_pass = $ args [2 ];
729+ $ num_posts = ( int ) $ args [3 ];
730730
731731 if (!$ this ->login_pass_ok ($ user_login , $ user_pass )) {
732732 return $ this ->error ;
@@ -789,9 +789,9 @@ function mw_getCategories($args) {
789789
790790 $ this ->escape ($ args );
791791
792- $ blog_ID = $ args [0 ];
793- $ user_login = $ args [1 ];
794- $ user_pass = $ args [2 ];
792+ $ blog_ID = ( int ) $ args [0 ];
793+ $ user_login = $ args [1 ];
794+ $ user_pass = $ args [2 ];
795795
796796 if (!$ this ->login_pass_ok ($ user_login , $ user_pass )) {
797797 return $ this ->error ;
@@ -823,7 +823,7 @@ function mw_newMediaObject($args) {
823823
824824 global $ wpdb ;
825825
826- $ blog_ID = $ wpdb -> escape ( $ args [0 ]) ;
826+ $ blog_ID = ( int ) $ args [0 ];
827827 $ user_login = $ wpdb ->escape ($ args [1 ]);
828828 $ user_pass = $ wpdb ->escape ($ args [2 ]);
829829 $ data = $ args [3 ];
@@ -863,10 +863,10 @@ function mt_getRecentPostTitles($args) {
863863
864864 $ this ->escape ($ args );
865865
866- $ blog_ID = $ args [0 ];
867- $ user_login = $ args [1 ];
868- $ user_pass = $ args [2 ];
869- $ num_posts = $ args [3 ];
866+ $ blog_ID = ( int ) $ args [0 ];
867+ $ user_login = $ args [1 ];
868+ $ user_pass = $ args [2 ];
869+ $ num_posts = ( int ) $ args [3 ];
870870
871871 if (!$ this ->login_pass_ok ($ user_login , $ user_pass )) {
872872 return $ this ->error ;
@@ -908,9 +908,9 @@ function mt_getCategoryList($args) {
908908
909909 $ this ->escape ($ args );
910910
911- $ blog_ID = $ args [0 ];
912- $ user_login = $ args [1 ];
913- $ user_pass = $ args [2 ];
911+ $ blog_ID = ( int ) $ args [0 ];
912+ $ user_login = $ args [1 ];
913+ $ user_pass = $ args [2 ];
914914
915915 if (!$ this ->login_pass_ok ($ user_login , $ user_pass )) {
916916 return $ this ->error ;
@@ -937,9 +937,9 @@ function mt_getPostCategories($args) {
937937
938938 $ this ->escape ($ args );
939939
940- $ post_ID = $ args [0 ];
941- $ user_login = $ args [1 ];
942- $ user_pass = $ args [2 ];
940+ $ post_ID = ( int ) $ args [0 ];
941+ $ user_login = $ args [1 ];
942+ $ user_pass = $ args [2 ];
943943
944944 if (!$ this ->login_pass_ok ($ user_login , $ user_pass )) {
945945 return $ this ->error ;
@@ -967,10 +967,10 @@ function mt_setPostCategories($args) {
967967
968968 $ this ->escape ($ args );
969969
970- $ post_ID = $ args [0 ];
971- $ user_login = $ args [1 ];
972- $ user_pass = $ args [2 ];
973- $ categories = $ args [3 ];
970+ $ post_ID = ( int ) $ args [0 ];
971+ $ user_login = $ args [1 ];
972+ $ user_pass = $ args [2 ];
973+ $ categories = $ args [3 ];
974974
975975 if (!$ this ->login_pass_ok ($ user_login , $ user_pass )) {
976976 return $ this ->error ;
@@ -1050,9 +1050,9 @@ function mt_publishPost($args) {
10501050
10511051 $ this ->escape ($ args );
10521052
1053- $ post_ID = $ args [0 ];
1054- $ user_login = $ args [1 ];
1055- $ user_pass = $ args [2 ];
1053+ $ post_ID = ( int ) $ args [0 ];
1054+ $ user_login = $ args [1 ];
1055+ $ user_pass = $ args [2 ];
10561056
10571057 if (!$ this ->login_pass_ok ($ user_login , $ user_pass )) {
10581058 return $ this ->error ;
@@ -1112,18 +1112,18 @@ function pingback_ping($args) {
11121112 } elseif (preg_match ('#p/[0-9]{1,}# ' , $ urltest ['path ' ], $ match )) {
11131113 // the path defines the post_ID (archives/p/XXXX)
11141114 $ blah = explode ('/ ' , $ match [0 ]);
1115- $ post_ID = $ blah [1 ];
1115+ $ post_ID = ( int ) $ blah [1 ];
11161116 $ way = 'from the path ' ;
11171117 } elseif (preg_match ('#p=[0-9]{1,}# ' , $ urltest ['query ' ], $ match )) {
11181118 // the querystring defines the post_ID (?p=XXXX)
11191119 $ blah = explode ('= ' , $ match [0 ]);
1120- $ post_ID = $ blah [1 ];
1120+ $ post_ID = ( int ) $ blah [1 ];
11211121 $ way = 'from the querystring ' ;
11221122 } elseif (isset ($ urltest ['fragment ' ])) {
11231123 // an #anchor is there, it's either...
11241124 if (intval ($ urltest ['fragment ' ])) {
11251125 // ...an integer #XXXX (simpliest case)
1126- $ post_ID = $ urltest ['fragment ' ];
1126+ $ post_ID = ( int ) $ urltest ['fragment ' ];
11271127 $ way = 'from the fragment (numeric) ' ;
11281128 } elseif (preg_match ('/post-[0-9]+/ ' ,$ urltest ['fragment ' ])) {
11291129 // ...a post id in the form 'post-###'
0 commit comments