code
stringlengths
12
2.05k
label_name
stringlengths
6
8
label
int64
0
95
def schedule_all Log.add_info(request, params.inspect) date_s = params[:date] if date_s.nil? or date_s.empty? @date = Date.today else @date = Date.parse(date_s) end if @login_user.nil? or params[:display].nil? or params[:display] == 'all' params[:display] = 'all' con ...
CWE-89
0
def supplied_file_media_types @supplied_file_media_types ||= MIME::Types.type_for(@name).collect(&:media_type) end
CWE-79
1
def rs256_decode_key(kid) jwks_x5c = jwks_key(:x5c, kid) if jwks_x5c.nil? raise OmniAuth::Auth0::TokenValidationError.new("Could not find a public key for Key ID (kid) '#{kid}''") end jwks_public_cert(jwks_x5c.first) end
CWE-347
25
def opposite_direction direction.to_sym == :asc ? :desc : :asc end
CWE-89
0
it 'should return nil if there is not key' do expect(jwt_validator.jwks_key(:auth0, jwks_kid)).to eq(nil) end
CWE-347
25
def package_index valid_http_methods :get required_parameters :project, :repository, :arch, :package # read access permission check if params[:package] == "_repository" prj = DbProject.get_by_name params[:project], use_source=false else pkg = DbPackage.get_by_project_and_name params[:...
CWE-434
5
it 'is possible to specify a custom formatter' do get '/' expect(last_response.body).to eq('{:custom_formatter=>"rain!"}') end
CWE-79
1
def add_label options, f, attr label_size = options.delete(:label_size) || "col-md-2" required_mark = check_required(options, f, attr) label = options[:label] == :none ? '' : options.delete(:label) label ||= ((clazz = f.object.class).respond_to?(:gettext_translation_for_attribute_name) && s_(c...
CWE-79
1
def mapped_content_type Paperclip.options[:content_type_mappings][filename_extension] end
CWE-79
1
def self.find_term(user_id, start_date, end_date) SqlHelper.validate_token([user_id]) start_s = start_date.strftime(Schedule::SYS_DATE_FORM) end_s = end_date.strftime(Schedule::SYS_DATE_FORM) con = "(user_id=#{user_id}) and (date >= '#{start_s}') and (date <= '#{end_s}')" ary = Timecard.where(c...
CWE-89
0
def gate_process HistoryHelper.keep_last(request) @login_user = User.find(session[:login_user_id]) begin if @login_user.nil? \ or @login_user.time_zone.nil? or @login_user.time_zone.empty? unless THETIS_USER_TIMEZONE_DEFAULT.nil? or THETIS_USER_TIMEZONE_DEFAULT.empty? ...
CWE-89
0
def self.get_default_for(user_id, xtype=nil) SqlHelper.validate_token([user_id, xtype]) con = [] con << "(user_id=#{user_id})" con << '(is_default=1)' con << "(xtype='#{xtype}')" unless xtype.blank? where = '' unless con.nil? or con.empty? where = 'where ' + con.join(' and ') ...
CWE-89
0
def self.on_desktop?(user, xtype, target_id) return false if user.nil? or xtype.nil? or target_id.nil? SqlHelper.validate_token([xtype, target_id]) con = "(user_id=#{user.id}) and (xtype='#{xtype}') and (target_id=#{target_id})" begin toy = Toy.where(con).first rescue => evar Log.a...
CWE-89
0
def self.get_carried_over(user_id, year) SqlHelper.validate_token([user_id, year]) yaml = ApplicationHelper.get_config_yaml unless yaml[:timecard].nil? paidhld_carry_over = yaml[:timecard]['paidhld_carry_over'] end return 0 if paidhld_carry_over.nil? or paidhld_carry_over.empty? or paidhl...
CWE-89
0
def exclude_from_group Log.add_info(request, params.inspect) if params[:group_id].nil? or params[:group_id].empty? render(:partial => 'ajax_groups', :layout => false) return end group_id = params[:group_id] begin @user = User.find(params[:id]) unless @user.nil? i...
CWE-89
0
def update_images_order Log.add_info(request, params.inspect) order_ary = params[:images_order] item = Item.find(params[:id]) item.images_without_content.each do |img| class << img def record_timestamps; false; end end img.update_attribute(:xorder, order_ary.index(img.id....
CWE-89
0
def test_html5_data_attributes_without_hyphenation assert_equal("<div data-author_id='123' data-biz='baz' data-foo='bar'></div>\n", render("%div{:data => {:author_id => 123, :foo => 'bar', :biz => 'baz'}}", :hyphenate_data_attrs => false)) assert_equal("<div data-one_plus_one='2'></div>\n", ...
CWE-79
1
def self.update_for(user_id, fiscal_year, num) SqlHelper.validate_token([user_id, fiscal_year]) if num <= 0 con = [] con << "(user_id=#{user_id})" con << "(year=#{fiscal_year})" PaidHoliday.destroy_all(con.join(' and ')) return end paid_holiday = PaidHoliday.get_for(us...
CWE-89
0
it "sanitizes crazy params" do cl = subject.build_command_line("true", modified_params) expect(cl).to eq "true --user bob --pass P@\\$sw0\\^\\&\\ \\|\\<\\>/-\\+\\*d\\% --db --desc=Some\\ Description --symkey --symkey-dash pkg1 some\\ pkg --pool 123 --pool 456" end
CWE-78
6
def set_auth_groups Log.add_info(request, params.inspect) @folder = Folder.find(params[:id]) if Folder.check_user_auth(@folder.id, @login_user, 'w', true) read_groups = [] write_groups = [] groups_auth = params[:groups_auth] unless groups_auth.nil? groups_auth.each do |au...
CWE-89
0
def self.get_team_folder(team_id) SqlHelper.validate_token([team_id]) begin return Folder.where("(owner_id=#{team_id}) and (xtype='#{Folder::XTYPE_TEAM}')").first rescue => evar Log.add_error(nil, evar) return nil end end
CWE-89
0
def self.get_using_size(mail_account_id, add_con=nil) SqlHelper.validate_token([mail_account_id]) con = [] con << "(mail_account_id=#{mail_account_id})" con << "(#{add_con})" unless add_con.nil? or add_con.empty? return (Email.count_by_sql("select SUM(size) from emails where #{con.join(' and ')...
CWE-89
0
def gate_process HistoryHelper.keep_last(request) @login_user = User.find_by_id(session[:login_user_id]) begin if @login_user.nil? \ or @login_user.time_zone.nil? or @login_user.time_zone.empty? unless THETIS_USER_TIMEZONE_DEFAULT.nil? or THETIS_USER_TIMEZONE_DEFAULT.empty? ...
CWE-89
0
def html_escape(s) s = s.to_s if s.html_safe? s else s.gsub(/[&"><]/) { |special| HTML_ESCAPE[special] }.html_safe end end
CWE-79
1
def rename Log.add_info(request, params.inspect) @group = Group.find(params[:id]) unless params[:thetisBoxEdit].nil? or params[:thetisBoxEdit].empty? @group.rename params[:thetisBoxEdit] end render(:partial => 'ajax_group_name', :layout => false) rescue => evar Log.add_error(request,...
CWE-89
0
def get_mail_content Log.add_info(request, params.inspect) mail_id = params[:id] begin @email = Email.find(mail_id) render(:partial => 'ajax_mail_content', :layout => false) rescue => evar Log.add_error(nil, evar) render(:text => '') end end
CWE-89
0
def test_new_attribute_interpolation assert_equal("<a href='12'>bar</a>\n", render('%a(href="1#{1 + 1}") bar')) assert_equal("<a href='2: 2, 3: 3'>bar</a>\n", render(%q{%a(href='2: #{1 + 1}, 3: #{foo}') bar}, :locals => {:foo => 3})) assert_equal(%Q{<a href='1\#{1 + 1}'>bar</a>\n}, render('%a(href="1\#{1 ...
CWE-79
1
def render_step(the_step, options = {}) if the_step.nil? || the_step.to_s == Wicked::FINISH_STEP redirect_to_finish_wizard options else render the_step, options end end
CWE-22
2
def order_by order_option = '' if self.order_column direction = self.order_direction || 'ASC' order_option = "#{self.order_column} #{direction}" end order_option.present? ? order_option : @@default_order end
CWE-89
0
def process_preflight(env) result = Result.preflight(env) resource, error = match_resource(env) unless resource result.miss(error) return {} end return resource.process_preflight(env, result) end
CWE-22
2
it "sanitizes Pathname param value" do cl = subject.build_command_line("true", nil => [Pathname.new("/usr/bin/ruby")]) expect(cl).to eq "true /usr/bin/ruby" end
CWE-78
6
def initialize(file, name) @file = file @name = name end
CWE-79
1
def match_resource(env) path = env[PATH_INFO] origin = env[HTTP_ORIGIN] origin_matched = false all_resources.each do |r| if r.allow_origin?(origin, env) origin_matched = true if found = r.match_resource(path, env) return [found, ni...
CWE-22
2
def index respond_to do |format| format.json do dir = params[:dir] dir = 'desc' unless SORT_DIRECTIONS.include?(dir.try(:upcase)) @occurrences = @bug.occurrences.order("occurred_at #{dir}").limit(50) last = params[:last].present? ? @bug.occurrences.find_by_number(params[:la...
CWE-94
14
def self.search_by_puppetclass(key, operator, value) conditions = "puppetclasses.name #{operator} '#{value_to_sql(operator, value)}'" hosts = Host.my_hosts.all(:conditions => conditions, :joins => :puppetclasses, :select => 'DISTINCT hosts.id').map(&:id) host_groups = Hostgr...
CWE-89
0
def check_owner return if params[:id].nil? or params[:id].empty? or @login_user.nil? mail_account = MailAccount.find(params[:id]) if !@login_user.admin?(User::AUTH_MAIL) and mail_account.user_id != @login_user.id Log.add_check(request, '[check_owner]'+request.to_s) flash[:notice] = t('msg....
CWE-89
0
def self.get_group_folder(group_id) SqlHelper.validate_token([group_id]) begin return Folder.where("(owner_id=#{group_id}) and (xtype='#{Folder::XTYPE_GROUP}')").first rescue => evar Log.add_error(nil, evar) return nil end end
CWE-89
0
def update_q_ctrl Log.add_info(request, params.inspect) item_id = params[:item_id] q_code = params[:q_code] q_param = params[:q_param] cap = params[:caption] yaml = Research.get_config_yaml type = q_param.split(':').first vals = q_param[type.length+1 .. -1] yaml[q_code] = {:ite...
CWE-89
0
def self.prepare_rdoc root debug, verbose = false, false prepare_script = Pathname.new(Rails.root) + "script/rdoc_prepare_script.rb" if prepare_script.executable? dirs = Environment.puppetEnvs.values.join(":").split(":").uniq.sort.join(" ") puts "Running #{prepare_script} #{dirs}" if debug ...
CWE-89
0
def update @campaign.update(campaign_params) end
CWE-79
1
def ffi_lib(*names) raise LoadError.new("library names list must not be empty") if names.empty? lib_flags = defined?(@ffi_lib_flags) ? @ffi_lib_flags : FFI::DynamicLibrary::RTLD_LAZY | FFI::DynamicLibrary::RTLD_LOCAL ffi_libs = names.map do |name| if name == FFI::CURRENT_PROCESS ...
CWE-426
70
def email user_info['email'] || id_info['email'] end
CWE-290
85
def authorized?(request) origin_host = request.get_header("HTTP_HOST")&.slice(VALID_ORIGIN_HOST, 1) || "" forwarded_host = request.x_forwarded_host&.slice(VALID_FORWARDED_HOST, 1) || "" @permissions.allows?(origin_host) && (forwarded_host.blank? || @permissions.allows?(forwarded_host)) ...
CWE-601
11
it 'should escape the content of removed `xmp` elements' do Sanitize.fragment('<xmp>hello! <script>alert(0)</script></xmp>') .must_equal 'hello! &lt;script&gt;alert(0)&lt;/script&gt;' end
CWE-79
1
def initialize(name, value = nil, charset = 'utf-8') case when name =~ /:/ # Field.new("field-name: field data") @charset = value.blank? ? charset : value @name, @value = split(name) when name !~ /:/ && value.blank? # Field.new("field-name") @name = name ...
CWE-93
33
def delete_attachment Log.add_info(request, '') # Not to show passwords. return unless request.post? target_user = nil user_id = params[:user_id] zeptair_id = params[:zeptair_id] attachment_id = params[:attachment_id] SqlHelper.validate_token([user_id, zeptair_id, attachment_id]) ...
CWE-89
0
def resolve_target_path(target, reader) return target if target_uri? target # Include file is resolved relative to dir of the current include, # or base_dir if within original docfile. path = reader.document.normalize_system_path(target, reader.dir, nil, ...
CWE-78
6
def self.new string_or_io from_document Nokogiri::XML(string_or_io) end
CWE-611
13
def supplied_file_content_types @supplied_file_content_types ||= MIME::Types.type_for(@name).collect(&:content_type) end
CWE-79
1
def get_users if params[:action] == 'get_users' Log.add_info(request, params.inspect) end @group_id = params[:id] =begin # @users = Group.get_users(params[:id]) =end # FEATURE_PAGING_IN_TREE >>> con = ['User.id > 0'] unless @group_id.nil? if @group_id == '0' con << "((gr...
CWE-89
0
def format_text(text, wrap, indent=0) result = [] work = text.dup while work.length > wrap do if work =~ /^(.{0,#{wrap}})[ \n]/ then result << $1.rstrip work.slice!(0, $&.length) else result << work.slice!(0, wrap) end end result << work if work.length.n...
CWE-94
14
def self.delete_statistics_group(group_id) yaml = Research.get_config_yaml if yaml.nil? or yaml[:statistics].nil? return [] end groups = yaml[:statistics][:groups] return [] if groups.nil? ary = groups.split('|') ary.delete group_id.to_s ary.compact! ary.delete '' ...
CWE-89
0
it 'is valid with valid attributes' do notification = build(:notification) expect(notification).to be_valid end
CWE-79
1
detectExtension(mimeType) { if (!mimeType) { return defaultExtension; } let parts = (mimeType || '') .toLowerCase() .trim() .split('/'); let rootType = parts.shift().trim(); let subType = parts.join('/').trim(); if (mim...
CWE-88
3
def self.get_for(user_id, date) begin con = "(user_id=#{user_id}) and (date='#{date}')" return Timecard.where(con).first rescue end return nil end
CWE-89
0
it "returns the right category group permissions for a regular user ordered by ascending group name" do json = described_class.new(category, scope: Guardian.new(user), root: false).as_json expect(json[:group_permissions]).to eq([ { permission_type: CategoryGroup.permission_types[:readon...
CWE-276
45
it "should raise an error if the image fails to be processed when downloaded" do stub_request(:get, "www.example.com/test.jpg").to_return(body: File.read(file_path("test.jpg"))) expect(running { @instance.remote_image_url = "http://www.example.com/test.jpg" }).to raise_error(CarrierWave::...
CWE-918
16
def team Log.add_info(request, params.inspect) date_s = params[:date] if date_s.nil? or date_s.empty? @date = Date.today else @date = Date.parse(date_s) end begin team = Team.find(params[:id]) team_users = team.get_users_a rescue => evar Log.add_error(reques...
CWE-89
0
def params super rescue Rack::Utils::ParameterTypeError, Rack::Utils::InvalidParameterError => e raise BadRequest, "Invalid query parameters: #{e.message}" end
CWE-79
1
def self.get_account_roots_for(user) return nil if user.nil? if user.kind_of?(User) user_id = user.id else user_id = user.to_s end SqlHelper.validate_token([user_id]) con = [] con << "(user_id=#{user_id})" con << "(xtype='#{MailFolder::XTYPE_ACCOUNT_ROOT}')" order_...
CWE-89
0
def self.normalize_key_names(options) options = options.dup if options.key?(:key_prefix) && !options.key?(:namespace) options[:namespace] = options.delete(:key_prefix) # RailsSessionStore end options[:raw] = !options[:marshalling] options end
CWE-502
15
def create Log.add_info(request, params.inspect) parent_id = params[:selectedFolderId] if params[:thetisBoxEdit].nil? or params[:thetisBoxEdit].empty? @mail_folder = nil else @mail_folder = MailFolder.new @mail_folder.name = params[:thetisBoxEdit] @mail_folder.parent_id = par...
CWE-89
0
def update_attachments_order Log.add_info(request, params.inspect) order_ary = params[:attachments_order] item = Item.find(params[:id]) item.attachments_without_content.each do |attach| class << attach def record_timestamps; false; end end attach.update_attribute(:xorder,...
CWE-89
0
def remove_application(user_ids) return if user_ids.nil? or user_ids.empty? SqlHelper.validate_token([user_ids]) con = ["(xtype='#{Comment::XTYPE_APPLY}')"] con << "(item_id=#{self.item_id})" user_con_a = [] user_ids.each do |user_id| user_con_a << "(user_id=#{user_id})" end ...
CWE-89
0
def get_auth_users Log.add_info(request, params.inspect) begin @folder = Folder.find(params[:id]) rescue @folder = nil end @users = [] session[:folder_id] = params[:id] if !@login_user.nil? and (@login_user.admin?(User::AUTH_FOLDER) or (!@folder.nil? and @folder.in_my_folde...
CWE-89
0
def self.find_by_sql_with_limit(sql, offset, limit) sql = sanitize_sql(sql) add_limit!(sql, {:limit => limit, :offset => offset}) find_by_sql(sql) end
CWE-89
0
it "with dofollowify disabled, links should be nofollowed" do @blog.dofollowify = false @blog.save expect(nofollowify_links('<a href="http://myblog.net">my blog</a>')). to eq('<a href="http://myblog.net" rel="nofollow">my blog</a>') end
CWE-79
1
def show_owners name response = rubygems_api_request :get, "api/v1/gems/#{name}/owners.yaml" do |request| request.add_field "Authorization", api_key end with_response response do |resp| owners = YAML.load resp.body say "Owners for gem: #{name}" owners.each do |owner| say ...
CWE-502
15
def output_versions output, versions versions.each do |gem_name, matching_tuples| matching_tuples = matching_tuples.sort_by { |n,_| n.version }.reverse platforms = Hash.new { |h,version| h[version] = [] } matching_tuples.each do |n, _| platforms[n.version] << n.platform if n.platform ...
CWE-94
14
def read_body(socket, block) return unless socket if tc = self['transfer-encoding'] case tc when /chunked/io then read_chunked(socket, block) else raise HTTPStatus::NotImplemented, "Transfer-Encoding: #{tc}." end elsif self['content-length'] || @remaining_size ...
CWE-444
41
def get_attachment Log.add_info(request, params.inspect) attach = Attachment.find(params[:id]) if attach.nil? redirect_to(THETIS_RELATIVE_URL_ROOT + '/404.html') return end parent_item = attach.item || ((attach.comment.nil?) ? nil : attach.comment.item) if parent_item.nil? or !pa...
CWE-89
0
def spoofed? if has_name? && has_extension? && media_type_mismatch? && mapping_override_mismatch? Paperclip.log("Content Type Spoof: Filename #{File.basename(@name)} (#{supplied_file_content_types}), content type discovered from file command: #{calculated_content_type}. See documentation to allow this...
CWE-79
1
def save_page Log.add_info(request, params.inspect) # Next page pave_val = params[:page].to_i + 1 @page = sprintf('%02d', pave_val) page_num = Dir.glob(File.join(Research.page_dir, "_q[0-9][0-9].html.erb")).length unless params[:research].nil? params[:research].each do |key, value| ...
CWE-89
0
def get_data_center_from_api_key(api_key) # Return an empty string for invalid API keys so Gibbon hits the main endpoint data_center = "" if api_key && api_key["-"] # Add a period since the data_center is a subdomain and it keeps things dry data_center = "#{api_key.split('-').last...
CWE-918
16
def list Log.add_info(request, params.inspect) con = [] @group_id = nil if !params[:thetisBoxSelKeeper].nil? @group_id = params[:thetisBoxSelKeeper].split(':').last elsif !params[:group_id].blank? @group_id = params[:group_id] end unless @group_id.nil? if @group_id == '...
CWE-89
0
def self.get_default_for(user_id, xtype=nil) SqlHelper.validate_token([user_id, xtype]) con = [] con << "(user_id=#{user_id})" con << '(is_default=1)' con << "(xtype='#{xtype}')" unless xtype.blank? where = '' unless con.nil? or con.empty? where = 'where ' + con.join(' and ') ...
CWE-89
0
def get_group_users Log.add_info(request, params.inspect) @group_id = nil if !params[:thetisBoxSelKeeper].nil? @group_id = params[:thetisBoxSelKeeper].split(':').last elsif !params[:group_id].nil? and !params[:group_id].empty? @group_id = params[:group_id] end submit_url = url_fo...
CWE-89
0
def check_mail_owner return if params[:id].nil? or params[:id].empty? or @login_user.nil? begin owner_id = Email.find(params[:id]).user_id rescue owner_id = -1 end if !@login_user.admin?(User::AUTH_MAIL) and owner_id != @login_user.id Log.add_check(request, '[check_mail_owner]'+...
CWE-89
0
def delete_attachment Log.add_info(request, '') # Not to show passwords. target_user = nil unless params[:user_id].blank? if @login_user.admin?(User::AUTH_ZEPTAIR) or @login_user.id.to_s == params[:user_id].to_s target_user = User.find(params[:user_id]) end end unless para...
CWE-89
0
def nofollowify_links(string) if this_blog.dofollowify string else string.gsub(/<a(.*?)>/i, '<a\1 rel="nofollow">') end end
CWE-79
1
it "converts to Punycode URI" do expect(subject.process_uri(uri).to_s).to eq 'http://xn--eckwd4c7cu47r2wf.jp/test.jpg' end
CWE-918
16
def test_should_sanitize_with_trailing_space raw = "display:block; " expected = "display: block;" assert_equal expected, sanitize_css(raw) end
CWE-79
1
def self.get_my_folder(user_id) SqlHelper.validate_token([user_id]) return Folder.where("(owner_id=#{user_id}) and (xtype='#{Folder::XTYPE_USER}')").first end
CWE-89
0
def make_hs256_token(payload = nil) payload = { sub: 'abc123' } if payload.nil? JWT.encode payload, client_secret, 'HS256' end
CWE-347
25
def is_a_copy?(folder_obj_cache=nil) return false if self.source_id.nil? # Exclude those created from system templates. src_item = Item.find_by_id(self.source_id) if src_item.nil? return true else return !src_item.in_system_folder?(folder_obj_cache) end end
CWE-89
0
it "should get the script it asks for" do def @bus.is_admin_lookup proc { |_| true } end get "/message-bus/_diagnostics/assets/message-bus.js" last_response.status.must_equal 200 last_response.content_type.must_equal "application/javascript;charset=UTF-8" end
CWE-22
2
def self.count_completed_users(item_id) SqlHelper.validate_token([item_id]) ack_msg = ZeptairDistHelper.completed_ack_message(item_id) return Comment.where("(item_id=#{item_id}) and (xtype='#{Comment::XTYPE_DIST_ACK}') and (message='#{ack_msg}')").count end
CWE-89
0
def test_new_attribute_interpolation assert_equal("<a href='12'>bar</a>\n", render('%a(href="1#{1 + 1}") bar')) assert_equal("<a href='2: 2, 3: 3'>bar</a>\n", render(%q{%a(href='2: #{1 + 1}, 3: #{foo}') bar}, :locals => {:foo => 3})) assert_equal(%Q{<a href='1\#{1 + 1}'>bar</a>\n}, render('%a(href="1\#{1 ...
CWE-79
1
def get_disp_ctrl Log.add_info(request, params.inspect) if params[:id] != '0' begin @folder = Folder.find(params[:id]) rescue => evar @folder = nil end end session[:folder_id] = params[:id] render(:partial => 'ajax_disp_ctrl', :layout => false) end
CWE-89
0
def create_event(comment) Event.create! bug_id: comment.bug_id, kind: 'comment', data: {'comment_id' => comment.id}, user_id: comment.user_id end
CWE-94
14
def test_verify_security_policy_checksum_missing skip 'openssl is missing' unless defined?(OpenSSL::SSL) @spec.cert_chain = [PUBLIC_CERT.to_pem] @spec.signing_key = PRIVATE_KEY build = Gem::Package.new @gem build.spec = @spec build.setup_signer FileUtils.mkdir 'lib' FileUtils.touch ...
CWE-347
25
def mget(*keys) options = (keys.pop if keys.last.is_a? Hash) || {} if keys.any? # Marshalling gets extended before Namespace does, so we need to pass options further if singleton_class.ancestors.include? Marshalling super(*keys.map {|key| interpolate(key) }, options...
CWE-502
15
def skip_node?(node) node.text? || node.cdata? end
CWE-79
1
def self.find_q_codes(html) q_hash = {} # |q_code, q_param| return q_hash if html.nil? all = Research.get_q_codes q_codes = html.scan(/[$](q\d{2}_\d{2})/) unless q_codes.nil? yaml = Research.get_config_yaml q_codes.each do |q_code_a| q_code = q_code_a.first i...
CWE-89
0
it 'should return a key' do expect(jwt_validator.jwks_key(:alg, jwks_kid)).to eq('RS256') end
CWE-347
25
def call(exception, locale, key, options) if exception.is_a?(MissingTranslation) options[:rescue_format] == :html ? exception.html_message : exception.message elsif exception.is_a?(Exception) raise exception else throw :exception, exception end e...
CWE-79
1
def sanitize_key(key) case key when Symbol then "--#{key.to_s.tr("_", "-")}" else key end
CWE-78
6
def get_path Log.add_info(request, params.inspect) if params[:thetisBoxSelKeeper].nil? or params[:thetisBoxSelKeeper].empty? @folder_path = '/' + t('paren.unknown') render(:partial => 'ajax_folder_path', :layout => false) return end @selected_id = params[:thetisBoxSelKeeper].split(...
CWE-89
0
def self.get_childs(folder_id, conditions, recursive, admin, ret_obj) SqlHelper.validate_token([folder_id]) arr = [] if recursive folder_tree = Folder.get_tree(Hash.new, conditions, folder_id, admin) return [] if folder_tree.nil? folder_tree.each do |parent_id, childs| if ret...
CWE-89
0
def check_owner return if params[:id].nil? or params[:id].empty? or @login_user.nil? begin owner_id = Item.find(params[:id]).user_id rescue owner_id = -1 end if !@login_user.admin?(User::AUTH_ITEM) and owner_id != @login_user.id Log.add_check(request, '[check_owner]'+request.to_...
CWE-89
0