FlatText.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace Sabre\VObject\Property;
  3. /**
  4. * FlatText property.
  5. *
  6. * This object represents certain TEXT values.
  7. *
  8. * Specifically, this property is used for text values where there is only 1
  9. * part. Semi-colons and colons will be de-escaped when deserializing, but if
  10. * any semi-colons or commas appear without a backslash, we will not assume
  11. * that they are delimiters.
  12. *
  13. * vCard 2.1 specifically has a whole bunch of properties where this may
  14. * happen, as it only defines a delimiter for a few properties.
  15. *
  16. * vCard 4.0 states something similar. An unescaped semi-colon _may_ be a
  17. * delimiter, depending on the property.
  18. *
  19. * @copyright Copyright (C) fruux GmbH (https://fruux.com/)
  20. * @author Evert Pot (http://evertpot.com/)
  21. * @license http://sabre.io/license/ Modified BSD License
  22. */
  23. class FlatText extends Text
  24. {
  25. /**
  26. * Field separator.
  27. *
  28. * @var string
  29. */
  30. public $delimiter = ',';
  31. /**
  32. * Sets the value as a quoted-printable encoded string.
  33. *
  34. * Overriding this so we're not splitting on a ; delimiter.
  35. *
  36. * @param string $val
  37. */
  38. public function setQuotedPrintableValue($val)
  39. {
  40. $val = quoted_printable_decode($val);
  41. $this->setValue($val);
  42. }
  43. }