Index: trunk/wap/hawpedia.php |
— | — | @@ -202,11 +202,9 @@ |
203 | 203 | curl_setopt($ch, CURLOPT_URL, $url); |
204 | 204 | curl_setopt($ch, CURLOPT_HEADER, 0); |
205 | 205 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
| 206 | + curl_setopt($ch, CURLOPT_USERAGENT, 'HawPedia (mobile.wikipedia.org)'); |
206 | 207 | curl_setopt($ch, CURLOPT_TIMEOUT, HAWPEDIA_TIMEOUT); |
207 | 208 | |
208 | | - // WP otherwise says: "Please provide a User-Agent header" |
209 | | - curl_setopt($ch, CURLOPT_USERAGENT, "hawpedia"); |
210 | | - |
211 | 209 | $curlResultString = curl_exec($ch); |
212 | 210 | if (!is_string($curlResultString)) |
213 | 211 | hawpedia_error(hawtra("Wikipedia currently not available")); // exits internally |
— | — | @@ -246,6 +244,7 @@ |
247 | 245 | curl_setopt($ch, CURLOPT_NOBODY, TRUE); |
248 | 246 | curl_setopt($ch, CURLOPT_FAILONERROR, TRUE); |
249 | 247 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
| 248 | + curl_setopt($ch, CURLOPT_USERAGENT, 'HawPedia (mobile.wikipedia.org)'); |
250 | 249 | curl_setopt($ch, CURLOPT_TIMEOUT, HAWPEDIA_TIMEOUT ); |
251 | 250 | curl_exec($ch); |
252 | 251 | $status = curl_getinfo( $ch, CURLINFO_HTTP_CODE ); |
— | — | @@ -275,6 +274,7 @@ |
276 | 275 | curl_setopt($ch, CURLOPT_URL, $url); |
277 | 276 | curl_setopt($ch, CURLOPT_HEADER, 0); |
278 | 277 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
| 278 | + curl_setopt($ch, CURLOPT_USERAGENT, 'HawPedia (mobile.wikipedia.org)'); |
279 | 279 | curl_setopt($ch, CURLOPT_TIMEOUT, HAWPEDIA_TIMEOUT); |
280 | 280 | $curlResultString = curl_exec($ch); |
281 | 281 | if (!is_string($curlResultString)) |