FlatText.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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) 2007-2014 fruux GmbH. All rights reserved.
  20. * @author Evert Pot (http://evertpot.com/)
  21. * @license http://sabre.io/license/ Modified BSD License
  22. */
  23. class FlatText extends Text {
  24. /**
  25. * Field separator
  26. *
  27. * @var string
  28. */
  29. public $delimiter = ',';
  30. /**
  31. * Sets the value as a quoted-printable encoded string.
  32. *
  33. * Overriding this so we're not splitting on a ; delimiter.
  34. *
  35. * @param string $val
  36. * @return void
  37. */
  38. public function setQuotedPrintableValue($val) {
  39. $val = quoted_printable_decode($val);
  40. $this->setValue($val);
  41. }
  42. }