From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 3C026E00C6B; Wed, 9 Mar 2016 06:57:00 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high * trust * [192.55.52.88 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 9C2DEE00C3C for ; Wed, 9 Mar 2016 06:52:22 -0800 (PST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP; 09 Mar 2016 06:52:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,311,1455004800"; d="scan'208,217";a="760971095" Received: from unknown (HELO lp.ger.corp.intel.com) ([10.252.22.130]) by orsmga003.jf.intel.com with ESMTP; 09 Mar 2016 06:52:20 -0800 From: Elliot Smith To: toaster@yoctoproject.org Date: Wed, 9 Mar 2016 14:52:15 +0000 Message-Id: <1457535135-5725-1-git-send-email-elliot.smith@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [PATCH] toaster: correctly handle quotes in project names X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Mar 2016 14:57:00 -0000 A project name like "Elliot's project" causes the "Rebuild" buttons in the most recent builds section to fail when clicked with: Uncaught SyntaxError: Unexpected token ILLEGAL This is because the single quote character causes the JavaScript for handling the button click event to be badly-formed. As the project name is passed to the scheduleBuild() function but doesn't actually do anything, this can be fixed by removing the project name from the arguments passed to scheduleBuild() (as well as the project URL, which is also ignored). Signed-off-by: Elliot Smith --- bitbake/lib/toaster/toastergui/templates/mrb_section.html | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/bitbake/lib/toaster/toastergui/templates/mrb_section.html b/bitbake/lib/toaster/toastergui/templates/mrb_section.html index 551e341..f43390f 100644 --- a/bitbake/lib/toaster/toastergui/templates/mrb_section.html +++ b/bitbake/lib/toaster/toastergui/templates/mrb_section.html @@ -109,10 +109,7 @@ {%endif%} pull-right" onclick='scheduleBuild({% url 'projectbuilds' build.project.id as bpi %}{{bpi|json}}, - {{build.project.name|json}}, - {% url 'project' build.project.id as purl %}{{purl|json}}, {{build.target_set.all|get_tasks|json}})'> - Rebuild {% endif %} @@ -134,7 +131,7 @@