PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / trunk
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More vtrunk
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | classes/helpers/FrmStringReaderHelper.php +5 -1 6.25 → trunk View file →
@@ -45,15 +45,18 @@
45 45 * Read characters until we reach the given character $char.
46 46 * By default, discard that final matching character and return the rest.
47 47 *
48 48 * @param string $char
49 + *
49 50 * @return string
50 51 */
51 52 public function read_until( $char ) {
52 53 $value = '';
54 +
53 55 while ( $this->pos <= $this->max && ( $one = $this->string[ $this->pos++ ] ) !== $char ) {
54 56 $value .= $one;
55 57 }
58 +
56 59 return $value;
57 60 }
58 61
59 62 /**
@@ -61,8 +64,9 @@
61 64 * whichever comes first.
62 65 * By default, remove enclosing double-quotes from the result.
63 66 *
64 67 * @param int $count
68 + *
65 69 * @return string
66 70 */
67 71 public function read( $count ) {
68 72 $value = '';
@@ -80,9 +84,9 @@
80 84 * abc => abc
81 85 * "abc" => abc
82 86 * ""abc"" => "abc"
83 87 */
84 - if ( strlen( $value ) < 2 || substr( $value, 0, 1 ) !== '"' || substr( $value, -1, 1 ) !== '"' ) {
88 + if ( strlen( $value ) < 2 || ! str_starts_with( $value, '"' ) || ! str_ends_with( $value, '"' ) ) {
85 89 // Only remove exactly one quote from the start and the end and then only if there is one at each end.
86 90 // Too short, or does not start or end with a quote.
87 91 return $value;
88 92 }