| Commit message (Collapse) | Author | Age | Lines |
|
|
|
| |
Update our session-stripping code.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The code that extracted the theme name from each entry in THEME_URLS (in
order to require code from a directory whose leaf name is the theme
name) only supported git URLs that ended in '.git'. However, the
themes:install rake task usefully supports a wider range of git URLs -
for example, all of the following were supported:
/home/whoever/themes/blah-theme => blah-theme
/home/whoever/themes/blah-theme/ => blah-theme
git://wherever/blah-theme.git => blah-theme
ssh://wherever/blah-theme.git// => blah-theme
This commit factors out a theme_url_to_theme_name method,
adds tests for it, and uses that method in both:
lib/tasks/themes.rake
config/initializers/theme_loader.rb
... so that a wider range of theme URLs are consistently supported.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The statistics on the status of the requests to a particular
public body are too slow to calculate on-the-fly, so this
commit adds:
* Extra columns on public_bodies to store counts of
the successful, not held, and overdue request counts
for each public body.
* A rake task which should be run periodically to update
the overdue request count column.
If Javascript is not available, the summary statistics are
shown as tables. If Javascript is available, graphs are
drawn with Flot.
|
|\
| |
| |
| |
| |
| | |
Conflicts:
locale/he_IL/app.po
locale/nb_NO/app.po
|
| |
| |
| |
| | |
errors when parsing large mails with envelopes on memory limited systems.
|
|/ |
|
|
|
|
|
|
|
|
|
| |
This use of eval allows arbitrary remote code execution on
parsing of a maliciously formed email.
Two tests are updated to match the behaviour of the new
code to return the display name - these introduce extra
escaping, so should be innocous.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This seems to be the bug mentioned here:
http://po-ru.com/diary/fixing-invalid-utf-8-in-ruby-revisited/
That explains that some versions of Iconv don't ignore
invalid characters when converting to UTF-8 even with
//IGNORE if that invalid character happens to be at the end
of the string. In fact, as Matthew Somerville pointed out,
with some versions of iconv (e.g. 1.14 on Mac OS, apparently)
it's necessary to add and remove more than one space at the end,
in case the first character of the byte sequence indicates a
long sequence. We add and remove 4 to be on the safe side.
|
|
|
|
|
|
|
|
|
|
| |
The behaviour of the TMail backend's 'to' and 'cc' methods
where there was a malformed To: or Cc: line was to return
nil, whereas Mail returns a version of the string anyway.
We'd have to change quite a lot of code to deal with an
extra possible class of returned objects, so it's simplest
for the moment to monkey-patch Mail::Message's 'to' and 'cc'
methods to restore the old behaviour.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Mail gem deals with multipart messages that look as if
they should have 1 part but are missing the final MIME boundary,
by make the parts list empty and setting part.body to the
text of the email. Rather than throwing an exception in this
case, we just pretend that part is text/plain and return it, so
that the page doesn't error and we still have a chance of some
useful text being displayed.
Note that we haven't investigated yet the case of emails that
have more than one start boundary, but no final boundary.
Fixes #921
|
|
|
|
| |
no charset field.
|
|
|
|
|
|
|
| |
These cases are rare, and probably need to be resolved by
reporting issues against the Mail gem (although it's debatable
what the more correct or pragmatic behaviour should be in both
cases).
|
|
|
|
|
| |
At one point in development this email was misparsed, so I've
added this as test to check for regressions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Throughout the codebase it is simplest and most consistent
if we could assume that all text/* attachments are represented
by UTF-8 strings, and this was largely true with the TMail
backend which ensured that all returned text parts were in
UTF-8. We have to change the replacement Mail-backed to
similarly attempt to convert text parts to UTF-8. This commit
introduces two functions which are useful for this.
The normalize_string_to_utf8 function will try various
encodings, either suggested or guessed (with charlock_holmes)
to convert the passed string to UTF-8, and if it can't find a
suitable encoding will throw an exception.
Unfortunately, the current behaviour of the site is that
uninterpretable text/* attachments are still passed around and
mangled to UTF-8 just before display. To mimic this it's also
useful to have the convert_string_to_utf8_or_binary function,
which tries to convert the string to UTF-8 with
normalize_string_to_utf8, but if that's not possible just
returns the original string. (In Ruby 1.9, encoding will be
set to UTF-8 or ASCII-8BIT appropriately.)
|
| |
|
|
|
|
|
|
|
| |
This example email indicates the wrong charset and includes
a top bit set character despite Content-Transfer-Encoding: 7bit
- nonetheless, we should be able to convert it to UTF-8 and
interpret the character correctly.
|
|
|
|
|
|
|
|
|
| |
If there is a missing final MIME boundary, the behaviour
of Alaveteli with the TMail backend was to still parse
the attachment, but with the new code it currently throws
an exception. This commit adds a test that asserts that
the attachment should be parsed despite the email being
malformed in this way.
|
|
|
|
|
|
|
|
|
|
|
| |
There is currently a difference in behaviour in the parsing
of nested MIME multipart attachments between the Mail and
TMail based backends. This commit adds a test that will
pass if the behaviour is the same as the the old (TMail-based)
version, which I believe is correct according to RFC 1521.
The example email has a PNG attachment after the final MIME
boundary, and the RFC says that anything after the final
boundary ("the epilogue") should be ignored.
|
|
|
|
|
|
|
|
|
|
|
| |
These two cases were ignored previously, and we need to make sure
that they still are under the switch from TMail to Mail.
One TNEF attachment is a heavily truncated one from a real example
from Alaveteli that has no personal data in it. The other is
an example from the tests in the distribution of the tnef
package for Ubuntu 1.4.9-1 - it's an HTML version of the US
constitution.
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
Gemfile.lock
app/controllers/public_body_controller.rb
app/mailers/track_mailer.rb
app/views/request/_hidden_correspondence.html.erb
app/views/request/_sidebar.html.erb
app/views/request/hidden.html.erb
app/views/request/new_please_describe.html.erb
app/views/request/preview.html.erb
app/views/user/show.html.erb
config/environment.rb
config/routes.rb
spec/controllers/public_body_controller_spec.rb
|
| |\
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
app/models/outgoing_message.rb
app/views/general/search.rhtml
app/views/public_body/list.rhtml
app/views/public_body/show.rhtml
app/views/public_body/view_email.rhtml
app/views/request/_after_actions.rhtml
app/views/request/_followup.rhtml
app/views/request/_sidebar.rhtml
app/views/request/new.rhtml
app/views/request/select_authority.rhtml
app/views/request/upload_response.rhtml
locale/aln/app.po
locale/app.pot
locale/ar/app.po
locale/bs/app.po
locale/ca/app.po
locale/cs/app.po
locale/cy/app.po
locale/de/app.po
locale/en/app.po
locale/en_IE/app.po
locale/es/app.po
locale/eu/app.po
locale/fr/app.po
locale/gl/app.po
locale/hu_HU/app.po
locale/id/app.po
locale/nb_NO/app.po
locale/pt_BR/app.po
locale/ro_RO/app.po
locale/sl/app.po
locale/sq/app.po
locale/sr@latin/app.po
locale/tr/app.po
locale/uk/app.po
|
| | | |
|
|\| |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
Gemfile
Gemfile.lock
app/controllers/admin_request_controller.rb
app/controllers/admin_track_controller.rb
app/controllers/request_controller.rb
app/controllers/services_controller.rb
app/helpers/link_to_helper.rb
app/mailers/request_mailer.rb
app/models/application_mailer.rb
app/models/info_request.rb
app/views/admin_censor_rule/edit.html.erb
app/views/admin_censor_rule/new.html.erb
app/views/admin_public_body/_form.html.erb
app/views/admin_public_body/_locale_selector.html.erb
app/views/admin_public_body/_one_list.html.erb
app/views/admin_public_body/edit.html.erb
app/views/admin_public_body/list.html.erb
app/views/admin_public_body/new.html.erb
app/views/admin_request/_incoming_message_actions.html.erb
app/views/admin_request/edit.html.erb
app/views/admin_request/edit_comment.html.erb
app/views/admin_request/edit_outgoing.html.erb
app/views/admin_request/list.html.erb
app/views/admin_request/list_old_unclassified.html.erb
app/views/admin_request/show.html.erb
app/views/admin_track/_some_tracks.html.erb
app/views/admin_track/list.html.erb
app/views/admin_user/edit.html.erb
app/views/admin_user/list.html.erb
app/views/admin_user/show.html.erb
app/views/general/_footer.html.erb
app/views/general/exception_caught.html.erb
app/views/help/contact.html.erb
app/views/layouts/default.html.erb
app/views/public_body/_alphabet.html.erb
app/views/request/_request_listing_single.html.erb
app/views/request/_sidebar.html.erb
app/views/request/new.html.erb
app/views/request/show.html.erb
app/views/request_mailer/external_response.rhtml
app/views/request_mailer/fake_response.rhtml
config/environment.rb
config/environments/production.rb
config/routes.rb
spec/controllers/admin_censor_rule_controller_spec.rb
spec/controllers/request_controller_spec.rb
spec/controllers/track_controller_spec.rb
spec/helpers/link_to_helper_spec.rb
spec/mailers/request_mailer_spec.rb
spec/models/info_request_spec.rb
spec/spec_helper.rb
spec/views/public_body/show.html.erb_spec.rb
spec/views/request/show.html.erb_spec.rb
vendor/plugins/rails_xss/lib/rails_xss/erubis.rb
|
| | | |
|
| |\ \
| | | |
| | | |
| | | | |
'openaustralia_github/backport_timezone_spec_rails_3_fix' into develop
|
| | |/
| | |
| | |
| | | |
attributes_before_type_cast instead
|
| |/ |
|
| | |
|
| | |
|
|\|
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
Gemfile
Gemfile.lock
config/environment.rb
lib/i18n_fixes.rb
|
| |\ |
|
| | | |
|
| | |
| | |
| | |
| | | |
commandline. Also, monkeypatch not needed anymore
|
| | | |
|
| | |
| | |
| | |
| | | |
anymore
|
| |/
|/|
| |
| | |
attributes_before_type_cast instead
|
| |
| |
| |
| | |
timezone. TMail renders headers using localtime, which is not ideal, but we're migrating away from it anyway, so I'm not sure it's worth delving into the internals of TMail to fix it.
|
| | |
|
| |
| |
| |
| | |
filenames, and within rfc822 subjects.
|
| | |
|
| |
| |
| |
| | |
function.
|
| |
| |
| |
| | |
get_attachment_text_one_file as it is now an externally-accessed method of the mail handler module.
|
| | |
|
| |
| |
| |
| | |
header strings from a mail.
|
| | |
|
| | |
|
| |
| |
| |
| | |
with the mail backend.
|
| | |
|
| |
| |
| |
| | |
getting the auto-submitted field.
|