4 if($wgUseTeX) require_once( "Math.php" );
7 var $mHeaders, $mCookies, $mMetatags, $mKeywords;
8 var $mLinktags, $mPagetitle, $mBodytext, $mDebugtext;
9 var $mHTMLtitle, $mRobotpolicy, $mIsarticle, $mPrintable;
10 var $mSubtitle, $mRedirect;
11 var $mLastModified, $mCategoryLinks;
14 var $mSuppressQuickbar;
17 var $mContainsOldMagic, $mContainsNewMagic;
18 var $mIsArticleRelated;
20 var $mShowFeedLinks = false;
21 var $mEnableClientCache = true;
25 $this->mHeaders
= $this->mCookies
= $this->mMetatags
=
26 $this->mKeywords
= $this->mLinktags
= array();
27 $this->mHTMLtitle
= $this->mPagetitle
= $this->mBodytext
=
28 $this->mRedirect
= $this->mLastModified
=
29 $this->mSubtitle
= $this->mDebugtext
= $this->mRobotpolicy
=
30 $this->mOnloadHandler
= "";
31 $this->mIsArticleRelated
= $this->mIsarticle
= $this->mPrintable
= true;
32 $this->mSuppressQuickbar
= $this->mPrintable
= false;
33 $this->mLanguageLinks
= array();
34 $this->mCategoryLinks
= array() ;
35 $this->mDoNothing
= false;
36 $this->mContainsOldMagic
= $this->mContainsNewMagic
= 0;
37 $this->mParserOptions
= ParserOptions
::newFromUser( $temp = NULL );
38 $this->mSquidMaxage
= 0;
42 function addHeader( $name, $val ) { array_push( $this->mHeaders
, "$name: $val" ) ; }
43 function addCookie( $name, $val ) { array_push( $this->mCookies
, array( $name, $val ) ); }
44 function redirect( $url, $responsecode = '302' ) { $this->mRedirect
= $url; $this->mRedirectCode
= $responsecode; }
46 # To add an http-equiv meta tag, precede the name with "http:"
47 function addMeta( $name, $val ) { array_push( $this->mMetatags
, array( $name, $val ) ); }
48 function addKeyword( $text ) { array_push( $this->mKeywords
, $text ); }
49 function addScript( $script ) { $this->mScripts
.= $script; }
50 function getScript() { return $this->mScripts
; }
52 function addLink( $linkarr ) {
53 # $linkarr should be an associative array of attributes. We'll escape on output.
54 array_push( $this->mLinktags
, $linkarr );
57 function addMetadataLink( $linkarr ) {
58 # note: buggy CC software only reads first "meta" link
59 static $haveMeta = false;
60 $linkarr["rel"] = ($haveMeta) ?
"alternate meta" : "meta";
61 $this->addLink( $linkarr );
65 # checkLastModified tells the client to use the client-cached page if
66 # possible. If sucessful, the OutputPage is disabled so that
67 # any future call to OutputPage->output() have no effect. The method
68 # returns true iff cache-ok headers was sent.
69 function checkLastModified ( $timestamp )
71 global $wgLang, $wgCachePages, $wgUser;
72 if( !$wgCachePages ) {
73 wfDebug( "CACHE DISABLED\n", false );
76 if( preg_match( '/MSIE ([1-4]|5\.0)/', $_SERVER["HTTP_USER_AGENT"] ) ) {
77 # IE 5.0 has probs with our caching
78 wfDebug( "-- bad client, not caching\n", false );
81 if( $wgUser->getOption( "nocache" ) ) {
82 wfDebug( "USER DISABLED CACHE\n", false );
86 $lastmod = gmdate( "D, j M Y H:i:s", wfTimestamp2Unix( max( $timestamp, $wgUser->mTouched
) ) ) . " GMT";
88 if( !empty( $_SERVER["HTTP_IF_MODIFIED_SINCE"] ) ) {
89 # IE sends sizes after the date like this:
90 # Wed, 20 Aug 2003 06:51:19 GMT; length=5202
91 # this breaks strtotime().
92 $modsince = preg_replace( '/;.*$/', '', $_SERVER["HTTP_IF_MODIFIED_SINCE"] );
93 $ismodsince = wfUnix2Timestamp( strtotime( $modsince ) );
94 wfDebug( "-- client send If-Modified-Since: " . $modsince . "\n", false );
95 wfDebug( "-- we might send Last-Modified : $lastmod\n", false );
97 if( ($ismodsince >= $timestamp ) and $wgUser->validateCache( $ismodsince ) ) {
98 # Make sure you're in a place you can leave when you call us!
99 header( "HTTP/1.0 304 Not Modified" );
100 $this->mLastModified
= $lastmod;
101 $this->sendCacheControl();
102 wfDebug( "CACHED client: $ismodsince ; user: $wgUser->mTouched ; page: $timestamp\n", false );
106 wfDebug( "READY client: $ismodsince ; user: $wgUser->mTouched ; page: $timestamp\n", false );
107 $this->mLastModified
= $lastmod;
110 wfDebug( "We're confused.\n", false );
111 $this->mLastModified
= $lastmod;
115 function getPageTitleActionText () {
119 return wfMsg('edit');
121 return wfMsg('history_short');
123 return wfMsg('unprotect');
125 return wfMsg('unprotect');
127 return wfMsg('delete');
129 return wfMsg('watch');
131 return wfMsg('unwatch');
133 return wfMsg('preview');
138 function setRobotpolicy( $str ) { $this->mRobotpolicy
= $str; }
139 function setHTMLTitle( $name ) {$this->mHTMLtitle
= $name; }
140 function setPageTitle( $name ) {
142 $this->mPagetitle
= $name;
143 if(!empty($action)) {
144 $taction = $this->getPageTitleActionText();
145 if( !empty( $taction ) ) {
146 $name .= " - $taction";
149 $this->setHTMLTitle( $name . " - " . wfMsg( "wikititlesuffix" ) );
151 function getHTMLTitle() { return $this->mHTMLtitle
; }
152 function getPageTitle() { return $this->mPagetitle
; }
153 function setSubtitle( $str ) { $this->mSubtitle
= $str; }
154 function getSubtitle() { return $this->mSubtitle
; }
155 function isArticle() { return $this->mIsarticle
; }
156 function setPrintable() { $this->mPrintable
= true; }
157 function isPrintable() { return $this->mPrintable
; }
158 function setSyndicated( $show = true ) { $this->mShowFeedLinks
= $show; }
159 function isSyndicated() { return $this->mShowFeedLinks
; }
160 function setOnloadHandler( $js ) { $this->mOnloadHandler
= $js; }
161 function getOnloadHandler() { return $this->mOnloadHandler
; }
162 function disable() { $this->mDoNothing
= true; }
164 function setArticleRelated( $v )
166 $this->mIsArticleRelated
= $v;
168 $this->mIsarticle
= false;
171 function setArticleFlag( $v ) {
172 $this->mIsarticle
= $v;
174 $this->mIsArticleRelated
= $v;
178 function isArticleRelated()
180 return $this->mIsArticleRelated
;
183 function getLanguageLinks() {
184 return $this->mLanguageLinks
;
186 function addLanguageLinks($newLinkArray) {
187 $this->mLanguageLinks +
= $newLinkArray;
189 function setLanguageLinks($newLinkArray) {
190 $this->mLanguageLinks
= $newLinkArray;
192 function getCategoryLinks() {
193 return $this->mCategoryLinks
;
195 function addCategoryLinks($newLinkArray) {
196 $this->mCategoryLinks +
= $newLinkArray;
198 function setCategoryLinks($newLinkArray) {
199 $this->mCategoryLinks +
= $newLinkArray;
202 function suppressQuickbar() { $this->mSuppressQuickbar
= true; }
203 function isQuickbarSuppressed() { return $this->mSuppressQuickbar
; }
205 function addHTML( $text ) { $this->mBodytext
.= $text; }
206 function debug( $text ) { $this->mDebugtext
.= $text; }
208 function setParserOptions( $options )
210 return wfSetVar( $this->mParserOptions
, $options );
213 # First pass--just handle <nowiki> sections, pass the rest off
214 # to doWikiPass2() which does all the real work.
216 # $cacheArticle - assume this text is the main text for the given article
218 function addWikiText( $text, $linestart = true, $cacheArticle = NULL )
220 global $wgParser, $wgParserCache, $wgUser, $wgTitle;
222 $parserOutput = $wgParser->parse( $text, $wgTitle, $this->mParserOptions
, $linestart );
223 if ( $cacheArticle ) {
224 $wgParserCache->save( $parserOutput, $cacheArticle, $wgUser );
227 $this->mLanguageLinks +
= $parserOutput->getLanguageLinks();
228 $this->mCategoryLinks +
= $parserOutput->getCategoryLinks();
229 $this->addHTML( $parserOutput->getText() );
232 function tryParserCache( $article, $user ) {
233 global $wgParserCache;
234 $parserOutput = $wgParserCache->get( $article, $user );
235 if ( $parserOutput !== false ) {
236 $this->mLanguageLinks +
= $parserOutput->getLanguageLinks();
237 $this->mCategoryLinks +
= $parserOutput->getCategoryLinks();
238 $this->addHTML( $parserOutput->getText() );
245 # Set the maximum cache time on the Squid in seconds
246 function setSquidMaxage( $maxage ) {
247 $this->mSquidMaxage
= $maxage;
250 # Use enableClientCache(false) to force it to send nocache headers
251 function enableClientCache( $state ) {
252 return wfSetVar( $this->mEnableClientCache
, $state );
255 function sendCacheControl() {
256 global $wgUseSquid, $wgUseESI;
257 # FIXME: This header may cause trouble with some versions of Internet Explorer
258 header( "Vary: Accept-Encoding, Cookie" );
259 if( $this->mEnableClientCache
) {
260 if( $wgUseSquid && ! isset( $_COOKIE[ini_get( "session.name") ] ) &&
261 ! $this->isPrintable() && $this->mSquidMaxage
!= 0 )
264 # We'll purge the proxy cache explicitly, but require end user agents
265 # to revalidate against the proxy on each visit.
266 # Surrogate-Control controls our Squid, Cache-Control downstream caches
267 wfDebug( "** proxy caching with ESI; {$this->mLastModified} **\n", false );
268 # start with a shorter timeout for initial testing
269 # header( 'Surrogate-Control: max-age=2678400+2678400, content="ESI/1.0"');
270 header( 'Surrogate-Control: max-age='.$wgSquidMaxage.'+'.$this->mSquidMaxage
.', content="ESI/1.0"');
271 header( 'Cache-Control: s-maxage=0, must-revalidate, max-age=0' );
273 # We'll purge the proxy cache for anons explicitly, but require end user agents
274 # to revalidate against the proxy on each visit.
275 # IMPORTANT! The Squid needs to replace the Cache-Control header with
276 # Cache-Control: s-maxage=0, must-revalidate, max-age=0
277 wfDebug( "** local proxy caching; {$this->mLastModified} **\n", false );
278 # start with a shorter timeout for initial testing
279 # header( "Cache-Control: s-maxage=2678400, must-revalidate, max-age=0" );
280 header( 'Cache-Control: s-maxage='.$this->mSquidMaxage
.', must-revalidate, max-age=0' );
283 # We do want clients to cache if they can, but they *must* check for updates
284 # on revisiting the page.
285 wfDebug( "** private caching; {$this->mLastModified} **\n", false );
286 header( "Expires: -1" );
287 header( "Cache-Control: private, must-revalidate, max-age=0" );
289 if($this->mLastModified
) header( "Last-modified: {$this->mLastModified}" );
291 wfDebug( "** no caching **\n", false );
293 # In general, the absence of a last modified header should be enough to prevent
294 # the client from using its cache. We send a few other things just to make sure.
295 header( "Expires: -1" );
296 header( "Cache-Control: no-cache, no-store, max-age=0, must-revalidate" );
297 header( "Pragma: no-cache" );
301 # Finally, all the text has been munged and accumulated into
302 # the object, let's actually output it:
306 global $wgUser, $wgLang, $wgDebugComments, $wgCookieExpiration;
307 global $wgInputEncoding, $wgOutputEncoding, $wgLanguageCode;
308 global $wgDebugRedirects, $wgMimeType;
309 if( $this->mDoNothing
){
312 $fname = "OutputPage::output";
313 wfProfileIn( $fname );
315 $sk = $wgUser->getSkin();
317 if ( "" != $this->mRedirect
) {
318 if( substr( $this->mRedirect
, 0, 4 ) != "http" ) {
319 # Standards require redirect URLs to be absolute
321 $this->mRedirect
= $wgServer . $this->mRedirect
;
323 if( $this->mRedirectCode
== '301') {
324 if( !$wgDebugRedirects ) {
325 header("HTTP/1.1 {$this->mRedirectCode} Moved Permanently");
327 $this->mLastModified
= gmdate( "D, j M Y H:i:s" ) . " GMT";
330 $this->sendCacheControl();
332 if( $wgDebugRedirects ) {
333 $url = htmlspecialchars( $this->mRedirect
);
334 print "<html>\n<head>\n<title>Redirect</title>\n</head>\n<body>\n";
335 print "<p>Location: <a href=\"$url\">$url</a></p>\n";
336 print "</body>\n</html>\n";
338 header( "Location: {$this->mRedirect}" );
344 $this->sendCacheControl();
346 header( "Content-type: $wgMimeType; charset={$wgOutputEncoding}" );
347 header( "Content-language: {$wgLanguageCode}" );
349 $exp = time() +
$wgCookieExpiration;
350 foreach( $this->mCookies
as $name => $val ) {
351 setcookie( $name, $val, $exp, "/" );
354 $sk->outputPage( $this );
360 global $wgInputEncoding, $wgOutputEncoding, $wgLang;
361 if ( 0 == strcmp( $wgInputEncoding, $wgOutputEncoding ) ) {
364 $outs = $wgLang->iconv( $wgInputEncoding, $wgOutputEncoding, $ins );
365 if ( false === $outs ) { $outs = $ins; }
370 function setEncodings()
372 global $wgInputEncoding, $wgOutputEncoding;
373 global $wgUser, $wgLang;
375 $wgInputEncoding = strtolower( $wgInputEncoding );
377 if( $wgUser->getOption( 'altencoding' ) ) {
378 $wgLang->setAltEncoding();
382 if ( empty( $_SERVER['HTTP_ACCEPT_CHARSET'] ) ) {
383 $wgOutputEncoding = strtolower( $wgOutputEncoding );
388 # This code is unused anyway!
389 # Commenting out. --bv 2003-11-15
391 $a = explode( ",", $_SERVER['HTTP_ACCEPT_CHARSET'] );
395 foreach ( $a as $s ) {
396 if ( preg_match( "/(.*);q=(.*)/", $s, $m ) ) {
408 #if ( "*" == $bestset ) { $bestset = "iso-8859-1"; }
409 if ( "*" == $bestset ) { $bestset = $wgOutputEncoding; }
410 $wgOutputEncoding = strtolower( $bestset );
415 $wgOutputEncoding = $wgInputEncoding;
418 # Returns a HTML comment with the elapsed time since request.
419 # This method has no side effects.
420 function reportTime()
422 global $wgRequestTime;
425 list( $usec, $sec ) = explode( " ", $wgRequestTime );
426 $start = (float)$sec +
(float)$usec;
427 $elapsed = $now - $start;
429 # Use real server name if available, so we know which machine
430 # in a server farm generated the current page.
431 if ( function_exists( "posix_uname" ) ) {
432 $uname = @posix_uname
();
436 if( is_array( $uname ) && isset( $uname['nodename'] ) ) {
437 $hostname = $uname['nodename'];
439 # This may be a virtual server.
440 $hostname = $_SERVER['SERVER_NAME'];
442 $com = sprintf( "<!-- Served by %s in %01.2f secs. -->",
443 $hostname, $elapsed );
447 # Note: these arguments are keys into wfMsg(), not text!
449 function errorpage( $title, $msg )
453 $this->mDebugtext
.= "Original title: " .
454 $wgTitle->getPrefixedText() . "\n";
455 $this->setPageTitle( wfMsg( $title ) );
456 $this->setHTMLTitle( wfMsg( "errorpagetitle" ) );
457 $this->setRobotpolicy( "noindex,nofollow" );
458 $this->setArticleRelated( false );
459 $this->enableClientCache( false );
461 $this->mBodytext
= "";
462 $this->addHTML( "<p>" . wfMsg( $msg ) . "</p>\n" );
463 $this->returnToMain( false );
469 function sysopRequired()
473 $this->setPageTitle( wfMsg( "sysoptitle" ) );
474 $this->setHTMLTitle( wfMsg( "errorpagetitle" ) );
475 $this->setRobotpolicy( "noindex,nofollow" );
476 $this->setArticleRelated( false );
477 $this->mBodytext
= "";
479 $sk = $wgUser->getSkin();
480 $ap = $sk->makeKnownLink( wfMsg( "administrators" ), "" );
481 $this->addHTML( wfMsg( "sysoptext", $ap ) );
482 $this->returnToMain();
485 function developerRequired()
489 $this->setPageTitle( wfMsg( "developertitle" ) );
490 $this->setHTMLTitle( wfMsg( "errorpagetitle" ) );
491 $this->setRobotpolicy( "noindex,nofollow" );
492 $this->setArticleRelated( false );
493 $this->mBodytext
= "";
495 $sk = $wgUser->getSkin();
496 $ap = $sk->makeKnownLink( wfMsg( "administrators" ), "" );
497 $this->addHTML( wfMsg( "developertext", $ap ) );
498 $this->returnToMain();
501 function loginToUse()
503 global $wgUser, $wgTitle, $wgLang;
505 $this->setPageTitle( wfMsg( "loginreqtitle" ) );
506 $this->setHTMLTitle( wfMsg( "errorpagetitle" ) );
507 $this->setRobotpolicy( "noindex,nofollow" );
508 $this->setArticleFlag( false );
509 $this->mBodytext
= "";
510 $this->addWikiText( wfMsg( "loginreqtext" ) );
512 # We put a comment in the .html file so a Sysop can diagnose the page the
514 $this->addHTML( "\n<!--" .
515 $wgLang->getNsText( $wgTitle->getNamespace() ) .
517 $wgTitle->getDBkey() . "-->" );
518 $this->returnToMain(); # Flip back to the main page after 10 seconds.
521 function databaseError( $fname, $sql, $error, $errno )
523 global $wgUser, $wgCommandLineMode;
525 $this->setPageTitle( wfMsgNoDB( "databaseerror" ) );
526 $this->setRobotpolicy( "noindex,nofollow" );
527 $this->setArticleRelated( false );
528 $this->enableClientCache( false );
530 if ( $wgCommandLineMode ) {
531 $msg = wfMsgNoDB( "dberrortextcl" );
533 $msg = wfMsgNoDB( "dberrortext" );
536 $msg = str_replace( "$1", htmlspecialchars( $sql ), $msg );
537 $msg = str_replace( "$2", htmlspecialchars( $fname ), $msg );
538 $msg = str_replace( "$3", $errno, $msg );
539 $msg = str_replace( "$4", htmlspecialchars( $error ), $msg );
541 if ( $wgCommandLineMode ||
!is_object( $wgUser )) {
545 $sk = $wgUser->getSkin();
546 $shlink = $sk->makeKnownLink( wfMsgNoDB( "searchhelppage" ),
547 wfMsgNoDB( "searchingwikipedia" ) );
548 $msg = str_replace( "$5", $shlink, $msg );
549 $this->mBodytext
= $msg;
554 function readOnlyPage( $source = null, $protected = false )
556 global $wgUser, $wgReadOnlyFile;
558 $this->setRobotpolicy( "noindex,nofollow" );
559 $this->setArticleRelated( false );
562 $this->setPageTitle( wfMsg( "viewsource" ) );
563 $this->addWikiText( wfMsg( "protectedtext" ) );
565 $this->setPageTitle( wfMsg( "readonly" ) );
566 $reason = file_get_contents( $wgReadOnlyFile );
567 $this->addWikiText( wfMsg( "readonlytext", $reason ) );
570 if( is_string( $source ) ) {
571 if( strcmp( $source, "" ) == 0 ) {
572 $source = wfMsg( "noarticletext" );
574 $rows = $wgUser->getOption( "rows" );
575 $cols = $wgUser->getOption( "cols" );
576 $text = "\n<textarea cols='$cols' rows='$rows' readonly='readonly'>" .
577 htmlspecialchars( $source ) . "\n</textarea>";
578 $this->addHTML( $text );
581 $this->returnToMain( false );
584 function fatalError( $message )
586 $this->setPageTitle( wfMsg( "internalerror" ) );
587 $this->setRobotpolicy( "noindex,nofollow" );
588 $this->setArticleRelated( false );
589 $this->enableClientCache( false );
591 $this->mBodytext
= $message;
596 function unexpectedValueError( $name, $val )
598 $this->fatalError( wfMsg( "unexpected", $name, $val ) );
601 function fileCopyError( $old, $new )
603 $this->fatalError( wfMsg( "filecopyerror", $old, $new ) );
606 function fileRenameError( $old, $new )
608 $this->fatalError( wfMsg( "filerenameerror", $old, $new ) );
611 function fileDeleteError( $name )
613 $this->fatalError( wfMsg( "filedeleteerror", $name ) );
616 function fileNotFoundError( $name )
618 $this->fatalError( wfMsg( "filenotfound", $name ) );
621 // return from error messages or notes
622 // auto: automatically redirect the user after 10 seconds
623 // returnto: page title to return to. Default is Main Page.
624 function returnToMain( $auto = true, $returnto = NULL )
626 global $wgUser, $wgOut, $wgRequest;
628 if ( $returnto == NULL ) {
629 $returnto = $wgRequest->getText( 'returnto' );
632 $sk = $wgUser->getSkin();
633 if ( "" == $returnto ) {
634 $returnto = wfMsg( "mainpage" );
636 $link = $sk->makeKnownLink( $returnto, "" );
638 $r = wfMsg( "returnto", $link );
640 $titleObj = Title
::newFromText( $returnto );
641 $wgOut->addMeta( "http:Refresh", "10;url=" . $titleObj->escapeFullURL() );
643 $wgOut->addHTML( "\n<p>$r</p>\n" );
646 # This function takes the existing and broken links for the page
647 # and uses the first 10 of them for META keywords
648 function addMetaTags ()
650 global $wgLinkCache , $wgOut ;
651 $good = array_keys ( $wgLinkCache->mGoodLinks
) ;
652 $bad = array_keys ( $wgLinkCache->mBadLinks
) ;
653 $a = array_merge ( $good , $bad ) ;
654 $a = array_slice ( $a , 0 , 10 ) ; # 10 keywords max
655 $a = implode ( "," , $a ) ;
660 $a = htmlspecialchars(preg_replace(array_keys($strip), array_values($strip),$a ));
662 $wgOut->addMeta ( "KEYWORDS" , $a ) ;
665 /* private */ function headElement()
667 global $wgDocType, $wgDTD, $wgLanguageCode, $wgOutputEncoding, $wgMimeType;
668 global $wgUser, $wgLang, $wgRequest;
670 $xml = ($wgMimeType == 'text/xml');
672 $ret = "<" . "?xml version=\"1.0\" encoding=\"$wgOutputEncoding\" ?" . ">\n";
677 $ret .= "<!DOCTYPE html PUBLIC \"$wgDocType\"\n \"$wgDTD\">\n";
679 if ( "" == $this->mHTMLtitle
) {
680 $this->mHTMLtitle
= wfMsg( "pagetitle", $this->mPagetitle
);
683 $xmlbits = "xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\"";
687 $rtl = $wgLang->isRTL() ?
" dir='RTL'" : "";
688 $ret .= "<html $xmlbits lang=\"$wgLanguageCode\" $rtl>\n";
689 $ret .= "<head>\n<title>" . htmlspecialchars( $this->mHTMLtitle
) . "</title>\n";
690 array_push( $this->mMetatags
, array( "http:Content-type", "$wgMimeType; charset={$wgOutputEncoding}" ) );
692 $ret .= $this->getHeadLinks();
694 if( $this->isPrintable() ) {
697 $media = "media='print'";
699 $printsheet = htmlspecialchars( "$wgStylePath/wikiprintable.css" );
700 $ret .= "<link rel='stylesheet' type='text/css' $media href='$printsheet' />\n";
702 $sk = $wgUser->getSkin();
703 $ret .= $sk->getHeadScripts();
704 $ret .= $this->mScripts
;
705 $ret .= $sk->getUserStyles();
711 function getHeadLinks() {
712 global $wgRequest, $wgStylePath;
714 foreach ( $this->mMetatags
as $tag ) {
715 if ( 0 == strcasecmp( "http:", substr( $tag[0], 0, 5 ) ) ) {
717 $tag[0] = substr( $tag[0], 5 );
721 $ret .= "<meta $a=\"{$tag[0]}\" content=\"{$tag[1]}\" />\n";
723 $p = $this->mRobotpolicy
;
724 if ( "" == $p ) { $p = "index,follow"; }
725 $ret .= "<meta name=\"robots\" content=\"$p\" />\n";
727 if ( count( $this->mKeywords
) > 0 ) {
732 $ret .= "<meta name=\"keywords\" content=\"" .
733 htmlspecialchars(preg_replace(array_keys($strip), array_values($strip),implode( ",", $this->mKeywords
))) . "\" />\n";
735 foreach ( $this->mLinktags
as $tag ) {
737 foreach( $tag as $attr => $val ) {
738 $ret .= " $attr=\"" . htmlspecialchars( $val ) . "\"";
742 if( $this->isSyndicated() ) {
743 # FIXME: centralize the mime-type and name information in Feed.php
744 $link = $wgRequest->escapeAppendQuery( "feed=rss" );
745 $ret .= "<link rel='alternate' type='application/rss+xml' title='RSS 2.0' href='$link' />\n";
746 $link = $wgRequest->escapeAppendQuery( "feed=atom" );
747 $ret .= "<link rel='alternate' type='application/rss+atom' title='Atom 0.3' href='$link' />\n";
749 # FIXME: get these working
750 # $fix = htmlspecialchars( $wgStylePath . "/ie-png-fix.js" );
751 # $ret .= "<!--[if gte IE 5.5000]><script type='text/javascript' src='$fix'></script><![endif]-->";