Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Wikipedia: Mediawiki-CVS

SVN: [37743] trunk/extensions/timeline

 

 

Wikipedia mediawiki-cvs RSS feed   Index | Next | Previous | View Threaded


nikerabbit at svn

Jul 16, 2008, 1:36 AM

Post #1 of 1 (102 views)
Permalink
SVN: [37743] trunk/extensions/timeline

Revision: 37743
Author: nikerabbit
Date: 2008-07-16 08:36:11 +0000 (Wed, 16 Jul 2008)

Log Message:
-----------
* Why is wfMsgReplaceArgs used here?!?
* Escaping
* mkdir is affected by umask, using wfMkdirParents instead

Modified Paths:
--------------
trunk/extensions/timeline/Timeline.i18n.php
trunk/extensions/timeline/Timeline.php

Modified: trunk/extensions/timeline/Timeline.i18n.php
===================================================================
--- trunk/extensions/timeline/Timeline.i18n.php 2008-07-16 08:26:43 UTC (rev 37742)
+++ trunk/extensions/timeline/Timeline.i18n.php 2008-07-16 08:36:11 UTC (rev 37743)
@@ -10,7 +10,7 @@
$messages['en'] = array(
'timeline-desc' => 'Adds <tt>&lt;timeline&gt;</tt> tag to create timelines',
'timeline-install-error' => 'Timeline error: Executable not found. Command line was: $1',
- 'timeline' => 'Timeline for $1', // Where $1 is the article name
+ 'timeline' => 'Timeline for page $1', // Where $1 is the page name
);

/** Afrikaans (Afrikaans)

Modified: trunk/extensions/timeline/Timeline.php
===================================================================
--- trunk/extensions/timeline/Timeline.php 2008-07-16 08:26:43 UTC (rev 37742)
+++ trunk/extensions/timeline/Timeline.php 2008-07-16 08:36:11 UTC (rev 37743)
@@ -40,8 +40,8 @@
$hash = md5( $timelinesrc );
$dest = $wgUploadDirectory."/timeline/";
wfLoadExtensionMessages('Timeline');
- if ( ! is_dir( $dest ) ) { mkdir( $dest, 0777 ); }
- if ( ! is_dir( $wgTmpDirectory ) ) { mkdir( $wgTmpDirectory, 0777 ); }
+ if ( ! is_dir( $dest ) ) { wfMkdirParents( $dest, 0777 ); }
+ if ( ! is_dir( $wgTmpDirectory ) ) { wfMkdirParents( $wgTmpDirectory, 0777 ); }

$fname = $dest . $hash;
if ( ! ( file_exists( $fname.".png" ) || file_exists( $fname.".err" ) ) )
@@ -59,7 +59,8 @@
unlink($fname);

if ( $ret == "" ) {
- return "<div id=\"toc\"><tt>" . wfMsgReplaceArgs( 'timeline-install-error', $cmdline ) . "</tt></div>";
+ $error = htmlspecialchars( wfMsg( 'timeline-install-error', $cmdline ) );
+ return "<div id=\"toc\"><tt>$eror</tt></div>";
}

}
@@ -77,9 +78,10 @@
$ext = "png";
}

+ $alt = htmlspecialchars( wfMsg('timeline', $wgTitle->getPrefixedText() ) );
+
$txt = "<map id=\"timeline_$hash\">{$map}</map>".
- "<img usemap=\"#timeline_{$hash}\" src=\"{$wgUploadPath}/timeline/{$hash}.{$ext}\" alt=\"" .
- wfMsgReplaceArgs('timeline', $wgTitle->getPrefixedText() ) . "\">";
+ "<img usemap=\"#timeline_{$hash}\" src=\"{$wgUploadPath}/timeline/{$hash}.{$ext}\" alt=\"$alt\" />";
}
return $txt;
}



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Wikipedia mediawiki-cvs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.