Skip to content

Commit

Permalink
Item9531: prevent chili from loading unknown recipes.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk@8709 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
MichaelDaum authored and MichaelDaum committed Aug 23, 2010
1 parent c204f04 commit 35bb29a
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -4,7 +4,8 @@ jQuery(function($) {
ChiliBook.codeLanguage = function( el ) {
var recipeName = jQuery(el).attr( "class" );
recipeName = recipeName.replace(/\s*{.*}\s*/, "");
return recipeName ? recipeName : '';
var re = /^(bash|cplusplus|csharp|css|delphi|html|java|js|lotusscript|php-f|php|recipes|sql|tml)$/;
return (recipeName && re.test(recipeName))?recipeName : '';
}

ChiliBook.recipeFolder = foswiki.getPreference("PUBURLPATH")+'/'+foswiki.getPreference("SYSTEMWEB")+'/JQueryPlugin/plugins/chili/recipes/';
Expand Down

0 comments on commit 35bb29a

Please sign in to comment.