r76875 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76874‎ | r76875 | r76876 >
Date:04:08, 17 November 2010
Author:tstarling
Status:deferred
Tags:
Comment:
Committing live hack.
Modified paths:
  • /trunk/wap/hawpedia.php (modified) (history)

Diff [purge]

Index: trunk/wap/hawpedia.php
@@ -202,11 +202,9 @@
203203 curl_setopt($ch, CURLOPT_URL, $url);
204204 curl_setopt($ch, CURLOPT_HEADER, 0);
205205 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
 206+ curl_setopt($ch, CURLOPT_USERAGENT, 'HawPedia (mobile.wikipedia.org)');
206207 curl_setopt($ch, CURLOPT_TIMEOUT, HAWPEDIA_TIMEOUT);
207208
208 - // WP otherwise says: "Please provide a User-Agent header"
209 - curl_setopt($ch, CURLOPT_USERAGENT, "hawpedia");
210 -
211209 $curlResultString = curl_exec($ch);
212210 if (!is_string($curlResultString))
213211 hawpedia_error(hawtra("Wikipedia currently not available")); // exits internally
@@ -246,6 +244,7 @@
247245 curl_setopt($ch, CURLOPT_NOBODY, TRUE);
248246 curl_setopt($ch, CURLOPT_FAILONERROR, TRUE);
249247 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
 248+ curl_setopt($ch, CURLOPT_USERAGENT, 'HawPedia (mobile.wikipedia.org)');
250249 curl_setopt($ch, CURLOPT_TIMEOUT, HAWPEDIA_TIMEOUT );
251250 curl_exec($ch);
252251 $status = curl_getinfo( $ch, CURLINFO_HTTP_CODE );
@@ -275,6 +274,7 @@
276275 curl_setopt($ch, CURLOPT_URL, $url);
277276 curl_setopt($ch, CURLOPT_HEADER, 0);
278277 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
 278+ curl_setopt($ch, CURLOPT_USERAGENT, 'HawPedia (mobile.wikipedia.org)');
279279 curl_setopt($ch, CURLOPT_TIMEOUT, HAWPEDIA_TIMEOUT);
280280 $curlResultString = curl_exec($ch);
281281 if (!is_string($curlResultString))

Status & tagging log