Permalink
Browse files

[full-history]

* Trunk merge from [3635]



git-svn-id: http://code.djangoproject.com/svn/django/branches/full-history@3641 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent cd54edf commit 19ed25e2e6ad9724b85e83ece5c69e23a0f95a2f Uroš Trebec committed Aug 21, 2006
View
@@ -68,6 +68,7 @@ answer newbie questions, and generally made Django that much better:
deric@monowerks.com
dne@mayonnaise.net
Jeremy Dunck <http://dunck.us/>
+ Andy Dustman <farcepest@gmail.com>
Clint Ecker
gandalf@owca.info
Baishampayan Ghose
@@ -11,15 +11,22 @@ def compile_messages():
elif os.path.isdir('locale'):
basedir = os.path.abspath('locale')
else:
- print "this script should be run from the django svn tree or your project or app tree"
+ print "This script should be run from the Django SVN tree or your project or app tree."
sys.exit(1)
for dirpath, dirnames, filenames in os.walk(basedir):
for f in filenames:
if f.endswith('.po'):
sys.stderr.write('processing file %s in %s\n' % (f, dirpath))
pf = os.path.splitext(os.path.join(dirpath, f))[0]
- cmd = 'msgfmt -o "%s.mo" "%s.po"' % (pf, pf)
+ # Store the names of the .mo and .po files in an environment
+ # variable, rather than doing a string replacement into the
+ # command, so that we can take advantage of shell quoting, to
+ # quote any malicious characters/escaping.
+ # See http://cyberelk.net/tim/articles/cmdline/ar01s02.html
+ os.environ['djangocompilemo'] = pf + '.mo'
+ os.environ['djangocompilepo'] = pf + '.po'
+ cmd = 'msgfmt -o "$djangocompilemo" "$djangocompilepo"'
os.system(cmd)
if __name__ == "__main__":
Binary file not shown.
Oops, something went wrong.

0 comments on commit 19ed25e

Please sign in to comment.