[aur-dev] [PATCH v2 3/3] pkg_comments.php: Add JavaScript function to edit comments

Marcel Korpel marcel.korpel at gmail.com
Tue Jul 21 16:49:01 UTC 2015


* Lukas Fleischer <lfleischer at archlinux.org> (Tue, 21 Jul 2015 18:34:27
+0200):
>> +                       _this = $(this);
> 
> Do we need an extra variable here?

Yes, we need to copy 'this' here to be able to use it within the
callback function, where 'this' has a different meaning.

> > +                        pkgbase_name: '<?=
> > htmlspecialchars($pkgbase_name) ?>'},
> 
> Can we use htmlspecialchars() here? If it is the right function to
> use, we need to add ENT_QUOTES at least...

Nope, we need json_encode() here.

> 
> > +                       function (data) {
> 
> Broken indentation?

Why? I indented all parameters with one tab, putting them on one line
creates a very long line.

You're correct about all the other things you mentioned.


More information about the aur-dev mailing list