1. 03 Sep, 2014 1 commit
  2. 13 Aug, 2014 2 commits
  3. 05 Jun, 2014 2 commits
  4. 19 May, 2014 1 commit
    • Alex Vandiver's avatar
      Serialize bytes, not characters, for Attachments and OCFV LargeContent · 0077837f
      Alex Vandiver authored
      Stop encoding all data as utf-8 before inserting -- it is clearly
      incorrect in the case of binary data.  While it is tempting to instead
      only encode as UTF-8 if it is textual data, this too is incorrect.
      
      As 18c810d0 describes, the character set of textual data is not
      guaranteed to be UTF-8; as such, by having stored characters instead of
      bytes in the serialized form, information has been lost.  There are two
      recovery methods, neither terribly appealing: update to store
      charset="utf-8" on all data on insert, or attempt to guess the original
      encoding and re-encode via that.  The former is distasteful because it
      alters the database upon serializing; the latter is fragile becase it is
      not guaranteed to be the same encoding.
      
      Instead, serialize the bytes as they occurred in the database, and
      import them explicitly as bytes.  This does make it possible to insert
      invalid UTF-8 into the database -- but contrary to what 74683a70
      implies, this is not incorrect, as binary data (for instance) is seldom
      UTF-8.  3a9c38ed ensures that anything which is contains high-bit
      characters will be QP-encoded.
      0077837f
  5. 15 May, 2014 1 commit
    • sunnavy's avatar
      avoid adding repeated cf values · cdcc4929
      sunnavy authored
      now RT::ObjectCustomFieldValues::HasEntry compares LargeContent and also
      canonicalizes values before comparision when possible.
      
      see also #4553
      
      btw, there was a bug that if you change a date cf from "2014-05-15" to
      "today"(which also means "2014-05-15" at that time), you will get a confusing
      message saying "2014-05-15 changed to 2014-05-15". this commit fixes it too.
      cdcc4929
  6. 12 May, 2014 2 commits
    • Alex Vandiver's avatar
      Respect the database Content-Type header in decoding textual parts · 18c810d0
      Alex Vandiver authored
      The definition of "texual" data has changed over time.  Specifically,
      7365c08a caused text/html messages to begin being stored as utf-8 in the
      database; prior to that, the claimed "charset" and bytes in the body
      were left unmolested during insertion.
      
      text/html attachments inserted into the database prior to 7365c08a,
      however, are now expected to be utf-8 when being extracted from the
      database.  This causes PERLQQ'd garbage to be displayed for the non-UTF8
      content stored in the database.  This type of error is likely to also
      re-occur in the future whenever the definition of "textual" data
      (i.e. data we transcode on insertion) changes.
      
      Respect the Content-Type header when decoding data from the database, or
      guess its value from the body; this mirrors the logic in
      RT::I18N::SetMIMEEntityToEncoding, which is what is done for
      currently-detected-as-textual parts on insert.  In cases like text/html
      prior to 7365c08a, the Content-Type header was not altered during
      database insertion -- and at worst, the claimed character set is
      incorrect and decoding will result in PERLQQ'd garbage.  This is no
      worse than said message were detected, received, converted, and stored
      in the database as text.
      18c810d0
    • Alex Vandiver's avatar
      Re-indent _EncodeLOB and _DecodeLOB · 1d8ef1cd
      Alex Vandiver authored
      1d8ef1cd
  7. 25 Apr, 2014 1 commit
    • Christian Loos's avatar
      tag SystemError transactions with an error class · 30061a24
      Christian Loos authored
      This makes it easy to make the SystemError transactions more visible to the
      user with a little bit of css.
      Previously the txn was tagged with the 'other' class.
      The new 'error' class use currently the same style as the previous 'other'
      class to not surprise the user with an layout change within an stable release.
      30061a24
  8. 06 Jan, 2014 2 commits
  9. 17 Dec, 2013 2 commits
  10. 16 Dec, 2013 2 commits
    • Kevin Falcone's avatar
      Instead of the flimsy utf8 encoding, use UTF-8 and fix bogus data. · 82403d5a
      Kevin Falcone authored
      Old versions of RT (especially those running on MySQL) were happy to pass
      garbage into MySQL and it was stored there, lurking, waiting for you to
      retrieve it.  If you do retrieve it and then try to treat it like UTF-8
      data (say by passing it to another system that strictly handles UTF-8
      such as PostgreSQL) it will be rejected vigorously.
      
      This converts from
      
      Encode::decode('utf8','string');
      which doesn't check the content and converts to perl's internal utf8.
      
      Encode::decode('UTF-8','string',Encode::PERLQQ);
      which converts to actual UTF-8 strings and will apply the PERLQQ filter
      documented in the Encode docs under Handling Malformed Data.
      
      This is similar to what we now do to all Web UI input in
      RT::Interface::Web::DecodeArgs
      82403d5a
    • Kevin Falcone's avatar
      _EncodeLOB expects to get an octet string. · 74683a70
      Kevin Falcone authored
      We were passing the character string returned from _DecodeLOB and
      persisted by Storable.  This caused checks of validity to fail and
      things that should have been encoded in Quoted-Printable to instead end
      up being passed directly to PostgreSQL which kicks them back as invalid
      UTF-8.
      
      Combined with our change to _DecodeLOB to now strictly decode to UTF-8
      and apply Encode::PerlQQ, we should no longer be able to pass invalid
      data along to the database.  The Encode::FB_Croak enforces this before
      we get to the DB.
      74683a70
  11. 20 Aug, 2013 1 commit
  12. 30 Jul, 2013 1 commit
  13. 11 Jul, 2013 1 commit
  14. 03 Jul, 2013 1 commit
  15. 29 Jun, 2013 1 commit
  16. 21 Jun, 2013 1 commit
  17. 18 Jun, 2013 1 commit
  18. 24 May, 2013 1 commit
  19. 12 Mar, 2013 1 commit
  20. 07 Mar, 2013 1 commit
  21. 07 Feb, 2013 1 commit
    • Alex Vandiver's avatar
      Ensure that ->_Accessible builds attributes when called as a class method · c1912850
      Alex Vandiver authored
      Prior to 5671e604, ->_Init was guaranteed to have been called prior to
      ->_Accessible, as the former is called during ->new, and the latter
      required an instance.  When calling it as a class method, that invariant
      does not hold, and autovivification causes an empty hash to be used.
      This, in turn, causes all column fetches on records of the class to fail
      with "___ unimplemented".
      
      Fill the attributes cache using _BuildTableAttributes, if it is not
      already.
      c1912850
  22. 06 Feb, 2013 1 commit
  23. 31 Jan, 2013 2 commits
  24. 23 Jan, 2013 1 commit
    • Kevin Falcone's avatar
      Check the id from the table and by loading the Object. · cc956231
      Kevin Falcone authored
      An optimization was added in a64a16d1 so that if you were trying to
      find the "Custom Field Object" from a Ticket, it would shortcut and
      return $ticket->Queue rather than loading $ticket->QueueObj->Id.
      
      Unfortunately, $ticket->Queue is protected by ShowTicket while
      $ticket->QueueObj->Id is protected by SeeQueue.  It's not uncommon in RT
      for a user to be granted SeeQueue and CreateTicket but not be given
      ShowTicket (a dropbox queue where you create tickets but then don't see
      them anymore).
      
      In this setup on 4.0.9, any custom field values entered on
      Ticket/Create.html will be silently discarded because $ticket->Queue
      returns undef. This results in the Custom Field not being found and
      AddCustomFieldValue not saving it.
      
      This was revealed in the RTIR test suite which tests just such a
      scenario using Constituencies (you can submit a ticket that you then
      can't see because it belongs to a separate Constituency).
      cc956231
  25. 18 Jan, 2013 1 commit
  26. 17 Jan, 2013 3 commits
  27. 14 Jan, 2013 1 commit
    • Alex Vandiver's avatar
      Remove hard tab characters wherever possible · 785dc2e3
      Alex Vandiver authored
      For historical reasons, many parts of the RT code intermix hard tabs and
      siace-based indentation.  This commit does not attempt to standardize
      indentation, merely the horrid intermixing of hard tabs and spaces.
      
      A few hard tabs remain in t/mail/mime_encoding.t and t/mail/outlook.t,
      as the tabs are within strings representing test data; they also remain
      in third-party source.
      
      Best viewed with the -w option to `git diff`.
      785dc2e3
  28. 11 Jan, 2013 2 commits
  29. 07 Jan, 2013 2 commits
    • Alex Vandiver's avatar
      Move RT::Record dependencies to runtime, not compile-time · e0921ff1
      Alex Vandiver authored
      Some of the "use RT::Foo" modules listed in RT::Record are themselves
      subclasses of RT::Record.  This means that RT::Record's methods are not
      necessarily initialized before the subclasses are loaded.  In tern, this
      causes the methods of RT::Record itself to be invisible to Role::Basic's
      "with" -- though methods of its superclass (DBIx::SearchBuilder::Record)
      are, as hey are pulled in earlier by the compile-time "use base" above.
      
      Move the import of RT::Foo classes to runtime, not compile-time.  This
      simplifies load order during compile-time, ensuring that a class loads
      all of its parent classes and roles without possibly creating load-order
      loops.  This also requires that any roles also declare their module
      dependencies using "require" as well.  As there are no notable "import"
      methods to RT's object classes, and (save for Role::Basic method
      resolution) compile-time checking is necessary, this is safe.
      e0921ff1
    • Kevin Falcone's avatar
      Bump copyright year to 2013 · 5da1fb27
      Kevin Falcone authored
      5da1fb27