function mb_strpos( $haystack, $needle, $offset = 0, $encoding = '' ) {
return Fallback::mb_strpos( $haystack, $needle, $offset, $encoding );
}
-
+
}
if( !function_exists( 'mb_strrpos' ) ) {
* "days=7&limit=100". Options in the first array override options in the second.
* Options set to "" will not be output.
*
- * @param $array1 Array( String|Array )
- * @param $array2 Array( String|Array )
+ * @param $array1 Array ( String|Array )
+ * @param $array2 Array ( String|Array )
* @param $prefix String
* @return String
*/
/* Provide an empty host for eg. file:/// urls (see bug 28627) */
if ( !isset( $bits['host'] ) ) {
$bits['host'] = '';
-
+
/* parse_url loses the third / for file:///c:/ urls (but not on variants) */
if ( substr( $bits['path'], 0, 1 ) !== '/' ) {
$bits['path'] = '/' . $bits['path'];
}
# Check for raw action using $_GET not $wgRequest, since the latter might not be initialised yet
if ( ( isset( $_GET['action'] ) && $_GET['action'] == 'raw' )
- || (
- isset( $_SERVER['SCRIPT_NAME'] )
- && substr( $_SERVER['SCRIPT_NAME'], -8 ) == 'load.php'
- ) )
+ || (
+ isset( $_SERVER['SCRIPT_NAME'] )
+ && substr( $_SERVER['SCRIPT_NAME'], -8 ) == 'load.php'
+ ) )
{
$cache = true;
} else {
/**
* Get microsecond timestamps for debug logs
- *
+ *
* @return string
*/
function wfDebugTimer() {
* Fetch server name for use in error reporting etc.
* Use real server name if available, so we know which machine
* in a server farm generated the current page.
- *
+ *
* @return string
*/
function wfHostname() {
function in_string( $needle, $str, $insensitive = false ) {
$func = 'strpos';
if( $insensitive ) $func = 'stripos';
-
+
return $func( $str, $needle ) !== false;
}
global $IP;
require_once( "$IP/includes/cache/MemcachedSessions.php" );
}
- session_set_save_handler( 'memsess_open', 'memsess_close', 'memsess_read',
+ session_set_save_handler( 'memsess_open', 'memsess_close', 'memsess_read',
'memsess_write', 'memsess_destroy', 'memsess_gc' );
- // It's necessary to register a shutdown function to call session_write_close(),
- // because by the time the request shutdown function for the session module is
+ // It's necessary to register a shutdown function to call session_write_close(),
+ // because by the time the request shutdown function for the session module is
// called, $wgMemc has already been destroyed. Shutdown functions registered
// this way are called before object destruction.
register_shutdown_function( 'memsess_write_close' );
* master position. Use this when updating very large numbers of rows, as
* in maintenance scripts, to avoid causing too much lag. Of course, this is
* a no-op if there are no slaves.
- *
+ *
* @param $maxLag Integer (deprecated)
* @param $wiki mixed Wiki identifier accepted by wfGetLB
* @return null
$codeBCP = array();
foreach ( $codeSegment as $segNo => $seg ) {
if ( count( $codeSegment ) > 0 ) {
- // when previous segment is x, it is a private segment and should be lc
+ // when previous segment is x, it is a private segment and should be lc
if( $segNo > 0 && strtolower( $codeSegment[($segNo - 1)] ) == 'x') {
$codeBCP[$segNo] = strtolower( $seg );
// ISO 3166 country code
}
/**
- * Unserialize a string to a PHP value without throwing E_NOTICE. Simply a
+ * Unserialize a string to a PHP value without throwing E_NOTICE. Simply a
* wrapper around unserialize()
- *
+ *
* @param $data string The serialized string
* @return mixed
*/
/**
* Work out an appropriate URL prefix containing scheme and host, based on
* information detected from $_SERVER
+ *
+ * @return string
*/
public static function detectServer() {
if ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] == 'on') {
* passed on as the value of this URL parameter
* @return array of URL variables to interpolate; empty if no match
*/
- private static function extractTitle( $path, $bases, $key=false ) {
+ private static function extractTitle( $path, $bases, $key = false ) {
foreach( (array)$bases as $keyValue => $base ) {
// Find the part after $wgArticlePath
$base = str_replace( '$1', '', $base );
* Extracts the given named values into an array.
* If no arguments are given, returns all input values.
* No transformation is performed on the values.
+ *
+ * @return array
*/
public function getValues() {
$names = func_get_args();
return htmlspecialchars( $this->appendQuery( $query ) );
}
+ /**
+ * @param $key
+ * @param $value
+ * @param $onlyquery bool
+ * @return String
+ */
public function appendQueryValue( $key, $value, $onlyquery = false ) {
return $this->appendQueryArray( array( $key => $value ), $onlyquery );
}
/**
* Return a WebRequestUpload object corresponding to the key
*
- * @param @key string
+ * @param $key string
* @return WebRequestUpload
*/
public function getUpload( $key ) {
$this->headers[ strtoupper( $tempName ) ] = $tempValue;
}
} else {
- $headers = $_SERVER;
foreach ( $_SERVER as $name => $value ) {
if ( substr( $name, 0, 5 ) === 'HTTP_' ) {
$name = str_replace( '_', '-', substr( $name, 5 ) );
/**
* Get a request header, or false if it isn't set
* @param $name String: case-insensitive header name
+ *
+ * @return string|false
*/
public function getHeader( $name ) {
$this->initHeaders();
* PATH_INFO or QUERY_STRING. If the request can't be allowed, show an error
* message or redirect to a safer URL. Returns true if the URL is OK, and
* false if an error message has been shown and the request should be aborted.
+ *
+ * @param $extWhitelist array
+ * @return bool
*/
public function checkUrlExtension( $extWhitelist = array() ) {
global $wgScriptExtension;
/**
* Attempt to redirect to a URL with a QUERY_STRING that's not dangerous in
* IE 6. Returns true if it was successful, false otherwise.
+ *
+ * @param $url string
+ * @return bool
*/
protected function doSecurityRedirect( $url ) {
header( 'Location: ' . $url );
$revision = Revision::newFromId( $row->rev_id );
if( $revision ) {
return '<p>' . htmlspecialchars( $revision->getUserText() ) . wfMsgForContent( 'colon-separator' ) .
- htmlspecialchars( FeedItem::stripComment( $revision->getComment() ) ) .
+ htmlspecialchars( FeedItem::stripComment( $revision->getComment() ) ) .
"</p>\n<hr />\n<div>" .
nl2br( htmlspecialchars( $revision->getText() ) ) . "</div>";
}
*/
class NewPagesPager extends ReverseChronologicalPager {
// Stored opts
- protected $opts, $mForm;
+ protected $opts;
+
+ /**
+ * @var HtmlForm
+ */
+ protected $mForm;
function __construct( $form, FormOptions $opts ) {
parent::__construct();
$this->opts = $opts;
}
+ /**
+ * @return Title
+ */
function getTitle() {
static $title = null;
if ( $title === null ) {
return $title;
}
+ /**
+ * @return User
+ */
function getUser() {
static $user = null;
if ( $user === null ) {
if ( $this->opts->getValue( 'hideredirs' ) ) {
$conds['page_is_redirect'] = 0;
}
-
+
// Allow changes to the New Pages query
$tables = array( 'recentchanges', 'page' );
$fields = array(