[4171] in BarnOwl Developers
Re: [barnowl/barnowl] Experimental Zulip support (#184)
daemon@ATHENA.MIT.EDU (=?UTF-8?B?QWxlamFuZHJvIFIuIFNlZGXD)
Tue Oct 17 03:11:03 2017
Date: Tue, 17 Oct 2017 03:52:23 +0000 (UTC)
From: =?UTF-8?B?QWxlamFuZHJvIFIuIFNlZGXDsW8=?= <notifications@github.com>
Reply-To: barnowl/barnowl <reply+004448c95518d16da5775af8f340737975dab8cb50f36d3e92cf0000000115fd407692a169ce0fd8a3d7@reply.github.com>
To: barnowl/barnowl <barnowl@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
In-Reply-To: <barnowl/barnowl/pull/184@github.com>
----==_mimepart_59e57e76eddfa_151653f969b190f34836c
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit
asedeno commented on this pull request.
> +
+sub baseclass {
+ my $self = shift;
+ return base_name($self->class);
+}
+
+sub baseinstance {
+ my $self = shift;
+ return base_name($self->instance);
+}
+
+sub quote_for_filter {
+ my $quote_chars = '!+*.?\[\]\^\\${}()|';
+ my $str = shift;
+ return ($str =~ s/[$quote_chars]/\\$1/gr);
+}
The '\\\\' in $quote_chars becomes a '\\' by the time it is interpolated, and then escapes the '$'. Also, you're not capturing the character class, so $1 isn't defined.
Isn't escaping fun? '\\\\\\\\'
NB: I had to add yet another layer of escaping just so the markdown would display what I wanted.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/barnowl/barnowl/pull/184#discussion_r145022333
----==_mimepart_59e57e76eddfa_151653f969b190f34836c
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: 7bit
<p><b>@asedeno</b> commented on this pull request.</p>
<hr>
<p>In <a href="https://github.com/barnowl/barnowl/pull/184#discussion_r145022333">perl/modules/Zulip/lib/BarnOwl/Message/Zulip.pm</a>:</p>
<pre style='color:#555'>> +
+sub baseclass {
+ my $self = shift;
+ return base_name($self->class);
+}
+
+sub baseinstance {
+ my $self = shift;
+ return base_name($self->instance);
+}
+
+sub quote_for_filter {
+ my $quote_chars = '!+*.?\[\]\^\\${}()|';
+ my $str = shift;
+ return ($str =~ s/[$quote_chars]/\\$1/gr);
+}
</pre>
<p>The '\\' in $quote_chars becomes a '\' by the time it is interpolated, and then escapes the '$'. Also, you're not capturing the character class, so $1 isn't defined.</p>
<p>Isn't escaping fun? '\\\\'</p>
<p>NB: I had to add yet another layer of escaping just so the markdown would display what I wanted.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/barnowl/barnowl/pull/184#discussion_r145022333">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AERIyYqjuTdQzoCuiLtd1pHiUYi87QqLks5stCR2gaJpZM4P6_o2">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AERIyXB1Abja0C_11278Lnv8P4ZZa6Ogks5stCR2gaJpZM4P6_o2.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="https://github.com/barnowl/barnowl/pull/184#discussion_r145022333"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/barnowl/barnowl","title":"barnowl/barnowl","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/barnowl/barnowl"}},"updates":{"snippets":[{"icon":"PERSON","message":"@asedeno commented on #184"}],"action":{"name":"View Pull Request","url":"https://github.com/barnowl/barnowl/pull/184#discussion_r145022333"}}}</script>
----==_mimepart_59e57e76eddfa_151653f969b190f34836c--