* <i>content</i>: fetch message for content language instead of interface
* Also can accept a single associative argument, of the form 'language' => 'xx':
* <i>language</i>: Language object or language code to fetch message for
- * (overriden by <i>content</i>), its behaviour with parser, parseinline
+ * (overriden by <i>content</i>), its behaviour with parse, parseinline
* and parsemag is undefined.
* Behavior for conflicting options (e.g., parse+parseinline) is undefined.
*/
*/
function wfEscapeWikiText( $text ) {
$text = str_replace(
- array( '[', '|', ']', '\'', 'ISBN ',
+ array( '[', '|', ']', '\'', 'ISBN ',
'RFC ', '://', "\n=", '{{', '}}' ),
- array( '[', '|', ']', ''', 'ISBN ',
+ array( '[', '|', ']', ''', 'ISBN ',
'RFC ', '://', "\n=", '{{', '}}' ),
htmlspecialchars( $text )
);
$uts = 0;
$da = array();
$strtime = '';
-
+
if ( $ts === 0 ) {
$uts = time();
$strtime = "@$uts";
return false;
}
-
+
static $formats = array(
TS_UNIX => 'U',
$ds = sprintf("%04d-%02d-%02dT%02d:%02d:%02d.00+00:00",
(int)$da[1], (int)$da[2], (int)$da[3],
(int)$da[4], (int)$da[5], (int)$da[6]);
-
+
$d = date_create( $ds, new DateTimeZone( 'GMT' ) );
} elseif ( $strtime ) {
$d = date_create( $strtime, new DateTimeZone( 'GMT' ) );
} elseif ( $strtime ) {
$uts = strtotime( $strtime );
}
-
+
if ( $uts === false ) {
wfDebug("wfTimestamp() can't parse the timestamp (non 32-bit time? Update php): $outputtype; $ts\n");
return false;
}
-
+
if ( TS_UNIX == $outputtype ) {
return $uts;
}
* @param $cmd String Command line, properly escaped for shell.
* @param &$retval optional, will receive the program's exit code.
* (non-zero is usually failure)
- * @param $environ Array optional environment variables which should be
+ * @param $environ Array optional environment variables which should be
* added to the executed command environment.
* @return collected stdout as a string (trailing newlines stripped)
*/
$envcmd = '';
foreach( $environ as $k => $v ) {
if ( wfIsWindows() ) {
- /* Surrounding a set in quotes (method used by wfEscapeShellArg) makes the quotes themselves
- * appear in the environment variable, so we must use carat escaping as documented in
- * http://technet.microsoft.com/en-us/library/cc723564.aspx
- * Note however that the quote isn't listed there, but is needed, and the parentheses
+ /* Surrounding a set in quotes (method used by wfEscapeShellArg) makes the quotes themselves
+ * appear in the environment variable, so we must use carat escaping as documented in
+ * http://technet.microsoft.com/en-us/library/cc723564.aspx
+ * Note however that the quote isn't listed there, but is needed, and the parentheses
* are listed there but doesn't appear to need it.
*/
$envcmd .= "set $k=" . preg_replace( '/([&|()<>^"])/', '^\\1', $v ) . ' && ';
} else {
- /* Assume this is a POSIX shell, thus required to accept variable assignments before the command
+ /* Assume this is a POSIX shell, thus required to accept variable assignments before the command
* http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_09_01
*/
$envcmd .= "$k=" . escapeshellarg( $v ) . ' ';
}
}
$cmd = $envcmd . $cmd;
-
+
if ( wfIsWindows() ) {
if ( version_compare( PHP_VERSION, '5.3.0', '<' ) && /* Fixed in 5.3.0 :) */
( version_compare( PHP_VERSION, '5.2.1', '>=' ) || php_uname( 's' ) == 'Windows NT' ) )
/**
* Get an object referring to a locally registered file.
* Returns a valid placeholder object if the file does not exist.
- * @param $title Either a string or Title object
+ * @param $title Title or String
* @return File, or null if passed an invalid Title
*/
function wfLocalFile( $title ) {
/**
* Returns the PackageRepository object for interaction with the package repository.
- *
- * TODO: Make the repository type also configurable.
- *
+ *
+ * TODO: Make the repository type also configurable.
+ *
* @since 1.17
- *
+ *
* @return PackageRepository
*/
function wfGetRepository() {
global $wgRepositoryApiLocation;
static $repository = false;
-
+
if ( $repository === false ) {
$repository = new DistributionRepository( $wgRepositoryApiLocation );
}
-
+
return $repository;
}