function stopTimer()
{
}
-
-}
+}
#------------------------------------------------------------------------------
# Global functions
return addslashes( $s );
}
-# Ideally we'd be using actual time fields in the db
-function wfTimestamp2Unix( $ts ) {
- return gmmktime( ( (int)substr( $ts, 8, 2) ),
- (int)substr( $ts, 10, 2 ), (int)substr( $ts, 12, 2 ),
- (int)substr( $ts, 4, 2 ), (int)substr( $ts, 6, 2 ),
- (int)substr( $ts, 0, 4 ) );
-}
-
-function wfUnix2Timestamp( $unixtime ) {
- return gmdate( "YmdHis", $unixtime );
-}
-
-function wfTimestampNow() {
- # return NOW
- return gmdate( "YmdHis" );
-}
-
-# Sorting hack for MySQL 3, which doesn't use index sorts for DESC
-function wfInvertTimestamp( $ts ) {
- return strtr(
- $ts,
- "0123456789",
- "9876543210"
- );
-}
-
function wfLimitResult( $limit, $offset ) {
return " LIMIT ".(is_numeric($offset)?"{$offset},":"")."{$limit} ";
}
+
?>
return pg_escape_string( $s );
}
-# Use PostgreSQL timestamp without timezone data type
-function wfTimestamp2Unix( $ts ) {
- return gmmktime( ( (int)substr( $ts, 11, 2) ),
- (int)substr( $ts, 14, 2 ), (int)substr( $ts, 17, 2 ),
- (int)substr( $ts, 5, 2 ), (int)substr( $ts, 8, 2 ),
- (int)substr( $ts, 0, 4 ) );
-}
-
-function wfUnix2Timestamp( $unixtime ) {
- return gmdate( "Y-m-d H:i:s", $unixtime );
-}
-
-function wfTimestampNow() {
- # return NOW
- return gmdate( "Y-m-d H:i:s" );
-}
-
-# Sorting hack for MySQL 3, which doesn't use index sorts for DESC
-function wfInvertTimestamp( $ts ) {
- $ts=preg_replace("/\D/","",$ts);
- return strtr(
- $ts,
- "0123456789",
- "9876543210"
- );
-}
-
function wfLimitResult( $limit, $offset ) {
return " LIMIT $limit ".(is_numeric($offset)?" OFFSET {$offset} ":"");
}
}
function importFormData( &$request ) {
- global $wgIsMySQL, $wgIsPg;
# These fields need to be checked for encoding.
# Also remove trailing whitespace, but don't remove _initial_
# whitespace from the text boxes. This may be significant formatting.
$this->summary = trim( $request->getText( "wpSummary" ) );
$this->edittime = $request->getVal( 'wpEdittime' );
- if ($wgIsMySQL)
- if( !preg_match( '/^\d{14}$/', $this->edittime )) $this->edittime = "";
- if ($wgIsPg)
- if ( !preg_match( '/^\d{4}-\d\d-\d\d \d\d:\d\d:\d\d$/',
- $this->edittime ))
- $this->edittime = "";
+ if( !preg_match( '/^\d{14}$/', $this->edittime )) $this->edittime = "";
$this->preview = $request->getCheck( 'wpPreview' );
$this->save = $request->wasPosted() && !$this->preview;
}
}
+
+# Ideally we'd be using actual time fields in the db
+function wfTimestamp2Unix( $ts ) {
+ return gmmktime( ( (int)substr( $ts, 8, 2) ),
+ (int)substr( $ts, 10, 2 ), (int)substr( $ts, 12, 2 ),
+ (int)substr( $ts, 4, 2 ), (int)substr( $ts, 6, 2 ),
+ (int)substr( $ts, 0, 4 ) );
+}
+
+function wfUnix2Timestamp( $unixtime ) {
+ return gmdate( "YmdHis", $unixtime );
+}
+
+function wfTimestampNow() {
+ # return NOW
+ return gmdate( "YmdHis" );
+}
+
+# Sorting hack for MySQL 3, which doesn't use index sorts for DESC
+function wfInvertTimestamp( $ts ) {
+ return strtr(
+ $ts,
+ "0123456789",
+ "9876543210"
+ );
+}
+
+
?>