MediaWiki  1.23.8
thumb.php
Go to the documentation of this file.
1 <?php
24 define( 'MW_NO_OUTPUT_COMPRESSION', 1 );
25 require __DIR__ . '/includes/WebStart.php';
26 
27 // Don't use fancy mime detection, just check the file extension for jpg/gif/png
29 
30 if ( defined( 'THUMB_HANDLER' ) ) {
31  // Called from thumb_handler.php via 404; extract params from the URI...
33 } else {
34  // Called directly, use $_GET params
36 }
37 
39 // Commit and close up!
41 $factory->commitMasterChanges();
42 $factory->shutdown();
43 
44 //--------------------------------------------------------------------------
45 
52  $params = get_magic_quotes_gpc()
53  ? array_map( 'stripslashes', $_GET )
54  : $_GET;
55 
56  wfStreamThumb( $params ); // stream the thumbnail
57 }
58 
64 function wfThumbHandle404() {
66 
67  # Set action base paths so that WebRequest::getPathInfo()
68  # recognizes the "X" as the 'title' in ../thumb_handler.php/X urls.
69  # Note: If Custom per-extension repo paths are set, this may break.
70  $repo = RepoGroup::singleton()->getLocalRepo();
71  $oldArticlePath = $wgArticlePath;
72  $wgArticlePath = $repo->getZoneUrl( 'thumb' ) . '/$1';
73 
75 
76  $wgArticlePath = $oldArticlePath;
77 
78  if ( !isset( $matches['title'] ) ) {
79  wfThumbError( 404, 'Could not determine the name of the requested thumbnail.' );
80  return;
81  }
82 
83  $params = wfExtractThumbRequestInfo( $matches['title'] ); // basic wiki URL param extracting
84  if ( $params == null ) {
85  wfThumbError( 400, 'The specified thumbnail parameters are not recognized.' );
86  return;
87  }
88 
89  wfStreamThumb( $params ); // stream the thumbnail
90 }
91 
106  global $wgVaryOnXFP;
107 
108  $section = new ProfileSection( __METHOD__ );
109 
110  $headers = array(); // HTTP headers to send
111 
112  $fileName = isset( $params['f'] ) ? $params['f'] : '';
113 
114  // Backwards compatibility parameters
115  if ( isset( $params['w'] ) ) {
116  $params['width'] = $params['w'];
117  unset( $params['w'] );
118  }
119  if ( isset( $params['p'] ) ) {
120  $params['page'] = $params['p'];
121  }
122 
123  // Is this a thumb of an archived file?
124  $isOld = ( isset( $params['archived'] ) && $params['archived'] );
125  unset( $params['archived'] ); // handlers don't care
126 
127  // Is this a thumb of a temp file?
128  $isTemp = ( isset( $params['temp'] ) && $params['temp'] );
129  unset( $params['temp'] ); // handlers don't care
130 
131  // Some basic input validation
132  $fileName = strtr( $fileName, '\\/', '__' );
133 
134  // Actually fetch the image. Method depends on whether it is archived or not.
135  if ( $isTemp ) {
136  $repo = RepoGroup::singleton()->getLocalRepo()->getTempRepo();
137  $img = new UnregisteredLocalFile( null, $repo,
138  # Temp files are hashed based on the name without the timestamp.
139  # The thumbnails will be hashed based on the entire name however.
140  # @todo fix this convention to actually be reasonable.
141  $repo->getZonePath( 'public' ) . '/' . $repo->getTempHashPath( $fileName ) . $fileName
142  );
143  } elseif ( $isOld ) {
144  // Format is <timestamp>!<name>
145  $bits = explode( '!', $fileName, 2 );
146  if ( count( $bits ) != 2 ) {
147  wfThumbError( 404, wfMessage( 'badtitletext' )->parse() );
148  return;
149  }
150  $title = Title::makeTitleSafe( NS_FILE, $bits[1] );
151  if ( !$title ) {
152  wfThumbError( 404, wfMessage( 'badtitletext' )->parse() );
153  return;
154  }
155  $img = RepoGroup::singleton()->getLocalRepo()->newFromArchiveName( $title, $fileName );
156  } else {
157  $img = wfLocalFile( $fileName );
158  }
159 
160  // Check the source file title
161  if ( !$img ) {
162  wfThumbError( 404, wfMessage( 'badtitletext' )->parse() );
163  return;
164  }
165 
166  // Check permissions if there are read restrictions
167  $varyHeader = array();
168  if ( !in_array( 'read', User::getGroupPermissions( array( '*' ) ), true ) ) {
169  if ( !$img->getTitle() || !$img->getTitle()->userCan( 'read' ) ) {
170  wfThumbError( 403, 'Access denied. You do not have permission to access ' .
171  'the source file.' );
172  return;
173  }
174  $headers[] = 'Cache-Control: private';
175  $varyHeader[] = 'Cookie';
176  }
177 
178  // Do rendering parameters extraction from thumbnail name.
179  if ( isset( $params['thumbName'] ) ) {
181  }
182  if ( $params == null ) {
183  wfThumbError( 400, 'The specified thumbnail parameters are not recognized.' );
184  return;
185  }
186 
187  // Check the source file storage path
188  if ( !$img->exists() ) {
189  $redirectedLocation = false;
190  if ( !$isTemp ) {
191  // Check for file redirect
192  // Since redirects are associated with pages, not versions of files,
193  // we look for the most current version to see if its a redirect.
194  $possRedirFile = RepoGroup::singleton()->getLocalRepo()->findFile( $img->getName() );
195  if ( $possRedirFile && !is_null( $possRedirFile->getRedirected() ) ) {
196  $redirTarget = $possRedirFile->getName();
197  $targetFile = wfLocalFile( Title::makeTitleSafe( NS_FILE, $redirTarget ) );
198  if ( $targetFile->exists() ) {
199  $newThumbName = $targetFile->thumbName( $params );
200  if ( $isOld ) {
201  $newThumbUrl = $targetFile->getArchiveThumbUrl(
202  $bits[0] . '!' . $targetFile->getName(), $newThumbName );
203  } else {
204  $newThumbUrl = $targetFile->getThumbUrl( $newThumbName );
205  }
206  $redirectedLocation = wfExpandUrl( $newThumbUrl, PROTO_CURRENT );
207  }
208  }
209  }
210 
211  if ( $redirectedLocation ) {
212  // File has been moved. Give redirect.
213  $response = RequestContext::getMain()->getRequest()->response();
214  $response->header( "HTTP/1.1 302 " . HttpStatus::getMessage( 302 ) );
215  $response->header( 'Location: ' . $redirectedLocation );
216  $response->header( 'Expires: ' .
217  gmdate( 'D, d M Y H:i:s', time() + 12 * 3600 ) . ' GMT' );
218  if ( $wgVaryOnXFP ) {
219  $varyHeader[] = 'X-Forwarded-Proto';
220  }
221  if ( count( $varyHeader ) ) {
222  $response->header( 'Vary: ' . implode( ', ', $varyHeader ) );
223  }
224  return;
225  }
226 
227  // If its not a redirect that has a target as a local file, give 404.
228  wfThumbError( 404, "The source file '$fileName' does not exist." );
229  return;
230  } elseif ( $img->getPath() === false ) {
231  wfThumbError( 500, "The source file '$fileName' is not locally accessible." );
232  return;
233  }
234 
235  // Check IMS against the source file
236  // This means that clients can keep a cached copy even after it has been deleted on the server
237  if ( !empty( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ) {
238  // Fix IE brokenness
239  $imsString = preg_replace( '/;.*$/', '', $_SERVER["HTTP_IF_MODIFIED_SINCE"] );
240  // Calculate time
242  $imsUnix = strtotime( $imsString );
244  if ( wfTimestamp( TS_UNIX, $img->getTimestamp() ) <= $imsUnix ) {
245  header( 'HTTP/1.1 304 Not Modified' );
246  return;
247  }
248  }
249 
250  unset( $params['r'] ); // ignore 'r' because we unconditionally pass File::RENDER
251  unset( $params['f'] ); // We're done with 'f' parameter.
252 
253  // Get the normalized thumbnail name from the parameters...
254  try {
255  $thumbName = $img->thumbName( $params );
256  if ( !strlen( $thumbName ) ) { // invalid params?
257  wfThumbError( 400, 'The specified thumbnail parameters are not valid.' );
258  return;
259  }
260  $thumbName2 = $img->thumbName( $params, File::THUMB_FULL_NAME ); // b/c; "long" style
261  } catch ( MWException $e ) {
262  wfThumbError( 500, $e->getHTML() );
263  return;
264  }
265 
266  // For 404 handled thumbnails, we only use the the base name of the URI
267  // for the thumb params and the parent directory for the source file name.
268  // Check that the zone relative path matches up so squid caches won't pick
269  // up thumbs that would not be purged on source file deletion (bug 34231).
270  if ( isset( $params['rel404'] ) ) { // thumbnail was handled via 404
271  if ( rawurldecode( $params['rel404'] ) === $img->getThumbRel( $thumbName ) ) {
272  // Request for the canonical thumbnail name
273  } elseif ( rawurldecode( $params['rel404'] ) === $img->getThumbRel( $thumbName2 ) ) {
274  // Request for the "long" thumbnail name; redirect to canonical name
275  $response = RequestContext::getMain()->getRequest()->response();
276  $response->header( "HTTP/1.1 301 " . HttpStatus::getMessage( 301 ) );
277  $response->header( 'Location: ' .
278  wfExpandUrl( $img->getThumbUrl( $thumbName ), PROTO_CURRENT ) );
279  $response->header( 'Expires: ' .
280  gmdate( 'D, d M Y H:i:s', time() + 7 * 86400 ) . ' GMT' );
281  if ( $wgVaryOnXFP ) {
282  $varyHeader[] = 'X-Forwarded-Proto';
283  }
284  if ( count( $varyHeader ) ) {
285  $response->header( 'Vary: ' . implode( ', ', $varyHeader ) );
286  }
287  return;
288  } else {
289  wfThumbError( 404, "The given path of the specified thumbnail is incorrect;
290  expected '" . $img->getThumbRel( $thumbName ) . "' but got '" .
291  rawurldecode( $params['rel404'] ) . "'." );
292  return;
293  }
294  }
295 
296  $dispositionType = isset( $params['download'] ) ? 'attachment' : 'inline';
297 
298  // Suggest a good name for users downloading this thumbnail
299  $headers[] = "Content-Disposition: {$img->getThumbDisposition( $thumbName, $dispositionType )}";
300 
301  if ( count( $varyHeader ) ) {
302  $headers[] = 'Vary: ' . implode( ', ', $varyHeader );
303  }
304 
305  // Stream the file if it exists already...
306  $thumbPath = $img->getThumbPath( $thumbName );
307  if ( $img->getRepo()->fileExists( $thumbPath ) ) {
308  $img->getRepo()->streamFile( $thumbPath, $headers );
309  return;
310  }
311 
312  $user = RequestContext::getMain()->getUser();
313  if ( $user->pingLimiter( 'renderfile' ) ) {
314  wfThumbError( 500, wfMessage( 'actionthrottledtext' )->parse() );
315  return;
316  } elseif ( wfThumbIsAttemptThrottled( $img, $thumbName, 5 ) ) {
317  wfThumbError( 500, wfMessage( 'thumbnail_image-failure-limit', 5 )->parse() );
318  return;
319  }
320 
321  // Thumbnail isn't already there, so create the new thumbnail...
322  try {
323  $thumb = $img->transform( $params, File::RENDER_NOW );
324  } catch ( Exception $ex ) {
325  // Tried to select a page on a non-paged file?
326  $thumb = false;
327  }
328 
329  // Check for thumbnail generation errors...
330  $errorMsg = false;
331  $msg = wfMessage( 'thumbnail_error' );
332  if ( !$thumb ) {
333  $errorMsg = $msg->rawParams( 'File::transform() returned false' )->escaped();
334  } elseif ( $thumb->isError() ) {
335  $errorMsg = $thumb->getHtmlMsg();
336  } elseif ( !$thumb->hasFile() ) {
337  $errorMsg = $msg->rawParams( 'No path supplied in thumbnail object' )->escaped();
338  } elseif ( $thumb->fileIsSource() ) {
339  $errorMsg = $msg->
340  rawParams( 'Image was not scaled, is the requested width bigger than the source?' )->escaped();
341  }
342 
343  if ( $errorMsg !== false ) {
344  wfThumbIncrAttemptFailures( $img, $thumbName );
345  wfThumbError( 500, $errorMsg );
346  } else {
347  // Stream the file if there were no errors
348  $thumb->streamFile( $headers );
349  }
350 }
351 
358 function wfThumbIsAttemptThrottled( File $img, $thumbName, $limit ) {
359  global $wgMemc;
360 
361  return ( $wgMemc->get( wfThumbAttemptKey( $img, $thumbName ) ) >= $limit );
362 }
363 
368 function wfThumbIncrAttemptFailures( File $img, $thumbName ) {
369  global $wgMemc;
370 
371  $key = wfThumbAttemptKey( $img, $thumbName );
372  if ( !$wgMemc->incr( $key, 1 ) ) {
373  if ( !$wgMemc->add( $key, 1, 3600 ) ) {
374  $wgMemc->incr( $key, 1 );
375  }
376  }
377 }
378 
384 function wfThumbAttemptKey( File $img, $thumbName ) {
385  global $wgAttemptFailureEpoch;
386 
387  return wfMemcKey( 'attempt-failures', $wgAttemptFailureEpoch,
388  $img->getRepo()->getName(), md5( $img->getName() ), md5( $thumbName ) );
389 }
390 
410 function wfExtractThumbRequestInfo( $thumbRel ) {
411  $repo = RepoGroup::singleton()->getLocalRepo();
412 
413  $hashDirReg = $subdirReg = '';
414  for ( $i = 0; $i < $repo->getHashLevels(); $i++ ) {
415  $subdirReg .= '[0-9a-f]';
416  $hashDirReg .= "$subdirReg/";
417  }
418 
419  // Check if this is a thumbnail of an original in the local file repo
420  if ( preg_match( "!^((archive/)?$hashDirReg([^/]*)/([^/]*))$!", $thumbRel, $m ) ) {
421  list( /*all*/, $rel, $archOrTemp, $filename, $thumbname ) = $m;
422  // Check if this is a thumbnail of an temp file in the local file repo
423  } elseif ( preg_match( "!^(temp/)($hashDirReg([^/]*)/([^/]*))$!", $thumbRel, $m ) ) {
424  list( /*all*/, $archOrTemp, $rel, $filename, $thumbname ) = $m;
425  } else {
426  return null; // not a valid looking thumbnail request
427  }
428 
429  $params = array( 'f' => $filename, 'rel404' => $rel );
430  if ( $archOrTemp === 'archive/' ) {
431  $params['archived'] = 1;
432  } elseif ( $archOrTemp === 'temp/' ) {
433  $params['temp'] = 1;
434  }
435 
436  $params['thumbName'] = $thumbname;
437  return $params;
438 }
439 
449  if ( !isset( $params['thumbName'] ) ) {
450  throw new MWException( "No thumbnail name passed to wfExtractThumbParams" );
451  }
452 
453  $thumbname = $params['thumbName'];
454  unset( $params['thumbName'] );
455 
456  // Do the hook first for older extensions that rely on it.
457  if ( !wfRunHooks( 'ExtractThumbParameters', array( $thumbname, &$params ) ) ) {
458  // Check hooks if parameters can be extracted
459  // Hooks return false if they manage to *resolve* the parameters
460  // This hook should be considered deprecated
461  wfDeprecated( 'ExtractThumbParameters', '1.22' );
462  return $params; // valid thumbnail URL (via extension or config)
463  }
464 
465  // FIXME: Files in the temp zone don't set a mime type, which means
466  // they don't have a handler. Which means we can't parse the param
467  // string. However, not a big issue as what good is a param string
468  // if you have no handler to make use of the param string and
469  // actually generate the thumbnail.
470  $handler = $file->getHandler();
471 
472  // Based on UploadStash::parseKey
473  $fileNamePos = strrpos( $thumbname, $params['f'] );
474  if ( $fileNamePos === false ) {
475  // Maybe using a short filename? (see FileRepo::nameForThumb)
476  $fileNamePos = strrpos( $thumbname, 'thumbnail' );
477  }
478 
479  if ( $handler && $fileNamePos !== false ) {
480  $paramString = substr( $thumbname, 0, $fileNamePos - 1 );
481  $extraParams = $handler->parseParamString( $paramString );
482  if ( $extraParams !== false ) {
483  return $params + $extraParams;
484  }
485  }
486 
487  // As a last ditch fallback, use the traditional common parameters
488  if ( preg_match( '!^(page(\d*)-)*(\d*)px-[^/]*$!', $thumbname, $matches ) ) {
489  list( /* all */, $pagefull, $pagenum, $size ) = $matches;
490  $params['width'] = $size;
491  if ( $pagenum ) {
492  $params['page'] = $pagenum;
493  }
494  return $params; // valid thumbnail URL
495  }
496  return null;
497 }
498 
506 function wfThumbError( $status, $msg ) {
507  global $wgShowHostnames;
508 
509  header( 'Cache-Control: no-cache' );
510  header( 'Content-Type: text/html; charset=utf-8' );
511  if ( $status == 404 ) {
512  header( 'HTTP/1.1 404 Not found' );
513  } elseif ( $status == 403 ) {
514  header( 'HTTP/1.1 403 Forbidden' );
515  header( 'Vary: Cookie' );
516  } else {
517  header( 'HTTP/1.1 500 Internal server error' );
518  }
519  if ( $wgShowHostnames ) {
520  header( 'X-MW-Thumbnail-Renderer: ' . wfHostname() );
521  $url = htmlspecialchars( isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : '' );
522  $hostname = htmlspecialchars( wfHostname() );
523  $debug = "<!-- $url -->\n<!-- $hostname -->\n";
524  } else {
525  $debug = '';
526  }
527  echo <<<EOT
528 <html><head><title>Error generating thumbnail</title></head>
529 <body>
530 <h1>Error generating thumbnail</h1>
531 <p>
532 $msg
533 </p>
534 $debug
535 </body>
536 </html>
537 
538 EOT;
539 }
File\THUMB_FULL_NAME
const THUMB_FULL_NAME
Definition: File.php:73
wfThumbHandleRequest
wfThumbHandleRequest()
Handle a thumbnail request via query parameters.
Definition: thumb.php:51
RepoGroup\singleton
static singleton()
Get a RepoGroup instance.
Definition: RepoGroup.php:53
wfThumbHandle404
wfThumbHandle404()
Handle a thumbnail request via thumbnail file URL.
Definition: thumb.php:64
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
$response
$response
Definition: opensearch_desc.php:32
$wgMemc
globals will be eliminated from MediaWiki replaced by an application object which would be passed to constructors Whether that would be an convenient solution remains to be but certainly PHP makes such object oriented programming models easier than they were in previous versions For the time being MediaWiki programmers will have to work in an environment with some global context At the time of globals were initialised on startup by MediaWiki of these were configuration which are documented in DefaultSettings php There is no comprehensive documentation for the remaining however some of the most important ones are listed below They are typically initialised either in index php or in Setup php For a description of the see design txt $wgTitle Title object created from the request URL $wgOut OutputPage object for HTTP response $wgUser User object for the user associated with the current request $wgLang Language object selected by user preferences $wgContLang Language object associated with the wiki being viewed $wgParser Parser object Parser extensions register their hooks here $wgRequest WebRequest to get request data $wgMemc
Definition: globals.txt:25
wfThumbAttemptKey
wfThumbAttemptKey(File $img, $thumbName)
Definition: thumb.php:384
wfTimestamp
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Definition: GlobalFunctions.php:2483
UnregisteredLocalFile
A file object referring to either a standalone local file, or a file in a local repository with no da...
Definition: UnregisteredLocalFile.php:36
wfSuppressWarnings
wfSuppressWarnings( $end=false)
Reference-counted warning suppression.
Definition: GlobalFunctions.php:2387
wfExtractThumbRequestInfo
wfExtractThumbRequestInfo( $thumbRel)
Convert pathinfo type parameter, into normal request parameters.
Definition: thumb.php:410
NS_FILE
const NS_FILE
Definition: Defines.php:85
$params
$params
Definition: styleTest.css.php:40
$limit
if( $sleep) $limit
Definition: importImages.php:99
wfHostname
wfHostname()
Fetch server name for use in error reporting etc.
Definition: GlobalFunctions.php:1786
wfExtractThumbParams
wfExtractThumbParams( $file, $params)
Convert a thumbnail name (122px-foo.png) to parameters, using file handler.
Definition: thumb.php:448
$wgTrivialMimeDetection
$wgTrivialMimeDetection
Definition: thumb.php:28
title
to move a page</td >< td > &*You are moving the page across *A non empty talk page already exists under the new or *You uncheck the box below In those you will have to move or merge the page manually if desired</td >< td > be sure to &You are responsible for making sure that links continue to point where they are supposed to go Note that the page will &a page at the new title
Definition: All_system_messages.txt:2703
File
Implements some public methods and some protected utility functions which are required by multiple ch...
Definition: File.php:50
based
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero based
Definition: hooks.txt:1956
ProfileSection
Class for handling function-scope profiling.
Definition: Profiler.php:60
MWException
MediaWiki exception.
Definition: MWException.php:26
wfMemcKey
wfMemcKey()
Get a cache key.
Definition: GlobalFunctions.php:3580
wfDeprecated
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
Definition: GlobalFunctions.php:1127
wfRestoreWarnings
wfRestoreWarnings()
Restore error level to previous value.
Definition: GlobalFunctions.php:2417
WebRequest\getPathInfo
static getPathInfo( $want='all')
Extract relevant query arguments from the http request uri's path to be merged with the normal php pr...
Definition: WebRequest.php:82
PROTO_CURRENT
const PROTO_CURRENT
Definition: Defines.php:270
wfMessage
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing after in associative array form externallinks including delete and has completed for all link tables default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "&lt
$factory
$factory
Definition: thumb.php:40
wfThumbError
wfThumbError( $status, $msg)
Output a thumbnail generation error message.
Definition: thumb.php:506
wfRunHooks
wfRunHooks( $event, array $args=array(), $deprecatedVersion=null)
Call hook functions defined in $wgHooks.
Definition: GlobalFunctions.php:4010
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
list
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
Definition: deferred.txt:11
false
processing should stop and the error should be shown to the user * false
Definition: hooks.txt:188
wfThumbIncrAttemptFailures
wfThumbIncrAttemptFailures(File $img, $thumbName)
Definition: thumb.php:368
will
</td >< td > &</td >< td > t want your writing to be edited mercilessly and redistributed at will
Definition: All_system_messages.txt:914
$section
$section
Definition: Utf8Test.php:88
Title\makeTitleSafe
static makeTitleSafe( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:422
$title
presenting them properly to the user as errors is done by the caller $title
Definition: hooks.txt:1324
$matches
if(!defined( 'MEDIAWIKI')) if(!isset( $wgVersion)) $matches
Definition: NoLocalSettings.php:33
$size
$size
Definition: RandomTest.php:75
User\getGroupPermissions
static getGroupPermissions( $groups)
Get the permissions associated with a given list of groups.
Definition: User.php:4097
File\getName
getName()
Return the name of this file.
Definition: File.php:273
RequestContext\getMain
static getMain()
Static methods.
Definition: RequestContext.php:420
HttpStatus\getMessage
static getMessage( $code)
Get the message associated with HTTP response code $code.
Definition: HttpStatus.php:37
$user
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
Definition: hooks.txt:237
$file
if(PHP_SAPI !='cli') $file
Definition: UtfNormalTest2.php:30
File\RENDER_NOW
const RENDER_NOW
Force rendering in the current process.
Definition: File.php:58
$wgArticlePath
$wgArticlePath
Definition: img_auth.php:48
$debug
$debug
Definition: Setup.php:498
wfGetLBFactory
& wfGetLBFactory()
Get the load balancer factory object.
Definition: GlobalFunctions.php:3678
on
We ve cleaned up the code here by removing clumps of infrequently used code and moving them off somewhere else It s much easier for someone working with this code to see what s _really_ going on
Definition: hooks.txt:86
are
The ContentHandler facility adds support for arbitrary content types on wiki instead of relying on wikitext for everything It was introduced in MediaWiki Each kind of and so on Built in content types are
Definition: contenthandler.txt:5
TS_UNIX
const TS_UNIX
Unix time - the number of seconds since 1970-01-01 00:00:00 UTC.
Definition: GlobalFunctions.php:2426
however
</span ></p > ! end ! test Comments and Indent Pre ! wikitext<!-- comment 1 --> asdf<!-- comment 1 --> asdf<!-- comment 2 --><!-- comment 1 --> asdf<!-- comment 2 --> xyz<!-- comment 1 --> asdf<!-- comment 2 --> xyz ! html< pre > asdf</pre >< pre > asdf</pre >< pre > asdf</pre >< p > xyz</p >< pre > asdf xyz</pre > ! end ! test Comment test ! wikitext asdf<!-- comment 1 --> jkl ! html< p > asdf jkl</p > ! end ! test Comment test ! wikitext asdf<!-- comment 1 --> jkl ! html< p > asdf</p >< p > jkl</p > ! end ! test Comment test ! wikitext asdf<!-- comment 1 --><!-- comment 2 --> jkl ! html< p > asdf jkl</p > ! end ! test Comment test ! wikitext asdf<!-- comment 1 --> jkl ! html< p > asdfjkl</p > ! end ! test Comment spacing ! wikitext a<!-- foo --> b<!-- bar --> c ! html< p > a</p >< pre > b</pre >< p > c</p > ! end ! test Comment whitespace ! wikitext<!-- returns a single newline, not nothing, since the newline after > is not stripped ! html ! end ! test Comment semantics and delimiters ! wikitext<!-- --><!----><!-----><!------> ! html ! end ! test Comment semantics and redux ! wikitext<!-- In SGML every "foo" here would actually show up in the text -- foo -- bar-- foo -- funky huh? ... --> ! html ! end ! test Comment semantics and that wouldn t be valid XML however
Definition: parserTests.txt:1131
name
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at name
Definition: design.txt:12
File\getRepo
getRepo()
Returns the repository.
Definition: File.php:1566
$e
if( $useReadline) $e
Definition: eval.php:66
wfLocalFile
wfLocalFile( $title)
Get an object referring to a locally registered file.
Definition: GlobalFunctions.php:3713
wfExpandUrl
wfExpandUrl( $url, $defaultProto=PROTO_CURRENT)
Expand a potentially local URL to a fully-qualified URL.
Definition: GlobalFunctions.php:497
wfLogProfilingData
wfLogProfilingData()
Definition: GlobalFunctions.php:1226
wfStreamThumb
wfStreamThumb(array $params)
Stream a thumbnail specified by parameters.
Definition: thumb.php:105
wfThumbIsAttemptThrottled
wfThumbIsAttemptThrottled(File $img, $thumbName, $limit)
Definition: thumb.php:358