@@ -81,21 +81,22 @@ public function __destruct()
8181 * @param string $url Url Endpoint
8282 *
8383 * @return bool TRUE nếu thành công, FALSE nếu thất bại
84- * @author: 713uk13m <[email protected] > 85- * @time : 10/16/18 17:15
8684 *
85+ * @author : 713uk13m <[email protected] > 86+ * @copyright: 713uk13m <[email protected] > 87+ * @time : 10/16/18 17:15
8788 */
8889 public static function backgroundHttpGet ($ url )
8990 {
9091 $ parts = parse_url ($ url );
91- if ($ parts ['scheme ' ] == 'https ' ) {
92- $ fp = fsockopen ('ssl:// ' . $ parts ['host ' ], isset ($ parts ['port ' ]) ? $ parts ['port ' ] : 443 , $ errno , $ errstr , 30 );
92+ if (strtolower ( $ parts ['scheme ' ]) == 'https ' ) {
93+ $ fp = fsockopen ('ssl:// ' . $ parts ['host ' ], isset ($ parts ['port ' ]) ? $ parts ['port ' ] : 443 , $ errno , $ errStr , 30 );
9394 } else {
94- $ fp = fsockopen ($ parts ['host ' ], isset ($ parts ['port ' ]) ? $ parts ['port ' ] : 80 , $ errno , $ errstr , 30 );
95+ $ fp = fsockopen ($ parts ['host ' ], isset ($ parts ['port ' ]) ? $ parts ['port ' ] : 80 , $ errno , $ errStr , 30 );
9596 }
9697 if (!$ fp ) {
9798 if (function_exists ('log_message ' )) {
98- log_message ('error ' , "ERROR: " . json_encode ($ errno ) . " - " . json_encode ($ errstr ));
99+ log_message ('error ' , "ERROR: " . json_encode ($ errno ) . " - " . json_encode ($ errStr ));
99100 }
100101
101102 return FALSE ;
@@ -118,21 +119,22 @@ public static function backgroundHttpGet($url)
118119 * @param string $paramString Params to Request
119120 *
120121 * @return bool TRUE nếu thành công, FALSE nếu thất bại
121- * @author: 713uk13m <[email protected] > 122- * @time : 10/16/18 17:16
123122 *
123+ * @author : 713uk13m <[email protected] > 124+ * @copyright: 713uk13m <[email protected] > 125+ * @time : 10/16/18 17:16
124126 */
125127 public static function backgroundHttpPost ($ url , $ paramString = '' )
126128 {
127129 $ parts = parse_url ($ url );
128130 if ($ parts ['scheme ' ] == 'https ' ) {
129- $ fp = fsockopen ('ssl:// ' . $ parts ['host ' ], isset ($ parts ['port ' ]) ? $ parts ['port ' ] : 443 , $ errno , $ errstr , 30 );
131+ $ fp = fsockopen ('ssl:// ' . $ parts ['host ' ], isset ($ parts ['port ' ]) ? $ parts ['port ' ] : 443 , $ errno , $ errStr , 30 );
130132 } else {
131- $ fp = fsockopen ($ parts ['host ' ], isset ($ parts ['port ' ]) ? $ parts ['port ' ] : 80 , $ errno , $ errstr , 30 );
133+ $ fp = fsockopen ($ parts ['host ' ], isset ($ parts ['port ' ]) ? $ parts ['port ' ] : 80 , $ errno , $ errStr , 30 );
132134 }
133135 if (!$ fp ) {
134136 if (function_exists ('log_message ' )) {
135- log_message ('error ' , "ERROR: " . json_encode ($ errno ) . " - " . json_encode ($ errstr ));
137+ log_message ('error ' , "ERROR: " . json_encode ($ errno ) . " - " . json_encode ($ errStr ));
136138 }
137139
138140 return FALSE ;
0 commit comments