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