code
stringlengths
12
2.05k
label_name
stringlengths
6
8
label
int64
0
95
foreach ($allgroups as $gid) { $g = group::getGroupById($gid); expPermissions::grantGroup($g, 'manage', $sloc); }
CWE-89
0
public function backup($type='json') { global $DB; global $website; $out = array(); $DB->query('SELECT * FROM nv_products WHERE website = '.protect($website->id), 'object'); if($type='json') $out = json_encode($DB->result()); return $out;...
CWE-89
0
function render_menu_page() { echo '<div class="wrap">'; echo '<h2>'.__('Blacklist Manager','all-in-one-wp-security-and-firewall').'</h2>';//Interface title $this->set_menu_tabs(); $tab = $this->get_current_tab(); $this->render_menu_tabs(); ?> ...
CWE-79
1
private function validateCodeInjectionInMetadata() { if ( \function_exists('exif_read_data') && \in_array($this->getMimeType(), ['image/jpeg', 'image/tiff']) && \in_array(exif_imagetype($this->path), [IMAGETYPE_JPEG, IMAGETYPE_TIFF_II, IMAGETYPE_TIFF_MM]) ) { $imageSize = getimagesize($this->path, $im...
CWE-79
1
function db_case($array) { global $DatabaseType; $counter = 0; if ($DatabaseType == 'mysqli') { $array_count = count($array); $string = " CASE WHEN $array[0] ="; $counter++; $arr_count = count($array); for ($i = 1; $i < $arr_count; $i++) { $value = $array[$i]; if ($value == "''" && substr($string, ...
CWE-79
1
function _makeChooseCheckbox($value, $title) { // return '<INPUT type=checkbox name=st_arr[] value=' . $value . ' checked>'; global $THIS_RET; return "<input name=unused[$THIS_RET[STUDENT_ID]] value=" . $THIS_RET[STUDENT_ID] . " type='checkbox' id=$THIS_RET[STUDENT_ID] onClick='setHiddenCheckboxStudents...
CWE-22
2
function edit_externalalias() { $section = isset($this->params['id']) ? $this->section->find($this->params['id']) : new section($this->params); if ($section->parent == -1) { notfoundController::handle_not_found(); exit; } // doesn't work for standalone pages ...
CWE-89
0
function output( $p_format = 'dot', $p_headers = false ) { # Check if it is a recognized format. if( !isset( $this->formats[$p_format] ) ) { trigger_error( ERROR_GENERIC, ERROR ); } $t_binary = $this->formats[$p_format]['binary']; $t_type = $this->formats[$p_format]['type']; $t_mime = $this->formats[$p...
CWE-78
6
AND subtype IN ('.implode(",", array_map(function($k){ return protect($k);}, $subtypes)).')'
CWE-89
0
protected function Start() { $sCurrentStepClass = $this->sInitialStepClass; $oStep = new $sCurrentStepClass($this, $this->sInitialState); $this->DisplayStep($oStep); }
CWE-918
16
public static function v () { return self::$version." ".self::$v_release; }
CWE-89
0
$tableBody[] = array($row['label'], $row['nb_visits'], $row['bounce_rate']); if ($count == 10) break; } $this->table($tableHead, $tableBody, null); } }
CWE-79
1
$json_response = ['status' => 'error', 'message' => $e->getMessage()];
CWE-79
1
new SessionHandlerProxy(new \SessionHandler()) : new NativeProxy(); }
CWE-89
0
public function testAllowsForRelativeUri() { $uri = (new Uri)->withPath('foo'); $this->assertEquals('foo', $uri->getPath()); $this->assertEquals('foo', (string) $uri); }
CWE-89
0
$extraFields[] = ['field' => $rule->field, 'id' => $field_option['id']];
CWE-89
0
protected function parse() { parent::parse(); // grab the error-type from the parameters $errorType = $this->getParameter('type'); // set correct headers switch($errorType) { case 'module-not-allowed': case 'action-not-allowed': SpoonHTTP::setHeadersByCode(403); break; case 'not-found'...
CWE-79
1
static function displayname() { return "Events"; }
CWE-89
0
public function localFileSystemSearchIteratorFilter($file, $key, $iterator) { if ($iterator->hasChildren()) { return (bool)$this->attr($key, 'read', null, true); } return ($this->stripos($file->getFilename(), $this->doSearchCurrentQuery) === false)? false : true; }
CWE-89
0
function db_start() { global $DatabaseServer, $DatabaseUsername, $DatabasePassword, $DatabaseName, $DatabasePort, $DatabaseType; switch ($DatabaseType) { case 'mysqli': $connection = new mysqli($DatabaseServer, $DatabaseUsername, $DatabasePassword, $DatabaseName, $DatabasePort); break; } // Error code for...
CWE-79
1
public function testValidatesUriCanBeParsed() { new Uri('///'); }
CWE-89
0
public static function meta($cont_title='', $cont_desc='', $pre =''){ global $data; //print_r($data); //if(empty($data['posts'][0]->title)){ if(is_array($data) && isset($data['posts'][0]->title)){ $sitenamelength = strlen(Options::get('sitename')); ...
CWE-89
0
public function testCanTransformAndRetrievePartsIndividually() { $uri = (new Uri('')) ->withFragment('#test') ->withHost('example.com') ->withPath('path/123') ->withPort(8080) ->withQuery('?q=abc') ->withScheme('http') -...
CWE-89
0
public function update() { $project = $this->getProject(); $values = $this->request->getValues(); list($valid, $errors) = $this->swimlaneValidator->validateModification($values); if ($valid) { if ($this->swimlaneModel->update($values['id'], $values)) { ...
CWE-639
9
public function remove() { $this->checkCSRFParam(); $project = $this->getProject(); $filter = $this->customFilterModel->getById($this->request->getIntegerParam('filter_id')); $this->checkPermission($project, $filter); if ($this->customFilterModel->remove($filter['id']))...
CWE-639
9
public function sendData($data) { $url = $this->getEndpoint().'?'.http_build_query($data, '', '&'); $httpRequest = $this->httpClient->get($url); $httpRequest->getCurlOptions()->set(CURLOPT_SSLVERSION, 6); // CURL_SSLVERSION_TLSv1_2 for libcurl < 7.35 $httpResponse = $httpRequest-...
CWE-89
0
foreach ($days as $value) { $regitem[] = $value; }
CWE-89
0
function show_vendor () { $vendor = new vendor(); if(isset($this->params['id'])) { $vendor = $vendor->find('first', 'id =' .$this->params['id']); $vendor_title = $vendor->title; $state = new geoRegion($vendor->state); $vendor->state = $state->name; //Removed unnecessary fields unset( ...
CWE-89
0
$section = new section($this->params); } else { notfoundController::handle_not_found(); exit; } if (!empty($section->id)) { $check_id = $section->id; } else { $check_id = $section->parent; } if (expPer...
CWE-89
0
public function getRecordTitle($id) { if (isset($this->faqRecord['id']) && ($this->faqRecord['id'] == $id)) { return $this->faqRecord['title']; } $question = ''; $query = sprintf( "SELECT thema AS question FROM ...
CWE-79
1
$fontfile = self::_getfontpath().$file; } elseif (@file_exists($file)) { $fontfile = $file; } return $fontfile; }
CWE-502
15
static function displayname() { return gt("Navigation"); }
CWE-89
0
static public function compress_png($path, $max_quality = 85) { $check = shell_exec("pngquant --version"); if(!$check) { return false; }else{ // guarantee that quality won't be worse than that. $min_quality = 60; // '-' makes it use ...
CWE-89
0
private function SearchFileContents() { $args = array(); $args[] = '-I'; $args[] = '--full-name'; $args[] = '--ignore-case'; $args[] = '-n'; $args[] = '-e'; $args[] = '"' . addslashes($this->search) . '"'; $args[] = $this->treeHash; $lines = explode("\n", $this->exe->Execute($this->project->GetPath...
CWE-78
6
foreach ($nodes as $node) { if ((($perm == 'view' && $node->public == 1) || expPermissions::check($perm, expCore::makeLocation('navigation', '', $node->id))) && !in_array($node->id, $ignore_ids)) { if ($node->active == 1) { $text = str_pad('', ($depth + ($full ...
CWE-89
0
public function disable() { $this->checkCSRFParam(); $project = $this->getProject(); $swimlane_id = $this->request->getIntegerParam('swimlane_id'); if ($this->swimlaneModel->disable($project['id'], $swimlane_id)) { $this->flash->success(t('Swimlane updated successful...
CWE-639
9
function init_args() { $args = new stdClass(); $args->req_id = isset($_REQUEST['requirement_id']) ? $_REQUEST['requirement_id'] : 0; $args->compare_selected_versions = isset($_REQUEST['compare_selected_versions']); $args->left_item_id = isset($_REQUEST['left_item_id']) ? intval($_REQUEST['left_item_id']) : -1;...
CWE-89
0
public function authenticate(CakeRequest $request, CakeResponse $response) { return self::getUser($request); }
CWE-502
15
function columnUpdate($table, $col, $val, $where=1) { $res = @mysqli_query($this->connection, "UPDATE `" . $this->prefix . "$table` SET `$col`='" . $val . "' WHERE $where"); /*if ($res == null) return array(); $objects = array(); for ($i = 0; $i < mysqli_num_rows...
CWE-89
0
public function sdm_save_upload_meta_data($post_id) { // Save File Upload metabox if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return; if (!isset($_POST['sdm_upload_box_nonce_check']) || !wp_verify_nonce($_POST['sdm_upload_box_nonce_check'], 'sdm_upload_box_nonce')) return; if (isset($_POST['sdm_...
CWE-79
1
public function uploadImage() { $filesCheck = array_filter($_FILES); if (!empty($filesCheck) && $this->approvedFileExtension($_FILES['file']['name'], 'image') && strpos($_FILES['file']['type'], 'image/') !== false) { ini_set('upload_max_filesize', '10M'); ini_set('post_max_size', '10M'); $tempFile = $_FI...
CWE-79
1
function process_subsections($parent_section, $subtpl) { global $db, $router; $section = new stdClass(); $section->parent = $parent_section->id; $section->name = $subtpl->name; $section->sef_name = $router->encode($section->name); $...
CWE-89
0
public static function sitemap() { switch (SMART_URL) { case true: # code... $url = Options::get('siteurl')."/sitemap".GX_URL_PREFIX; break; default: # code... $url = Options::get('siteurl')....
CWE-79
1
public function isActive() { if (PHP_VERSION_ID >= 50400) { return $this->active = \PHP_SESSION_ACTIVE === session_status(); } return $this->active; }
CWE-89
0
public function remove() { $this->checkCSRFParam(); $project = $this->getProject(); $filter = $this->customFilterModel->getById($this->request->getIntegerParam('filter_id')); $this->checkPermission($project, $filter); if ($this->customFilterModel->remove($filter['id']))...
CWE-639
9
function edit() { global $template; parent::edit(); $allforms = array(); $allforms[""] = gt('Disallow Feedback'); // calculate which event date is the one being edited $event_key = 0; foreach ($template->tpl->tpl_vars['record']->value->eventdate as $k...
CWE-89
0
public function confirm() { $task = $this->getTask(); $subtask = $this->getSubtask(); $this->response->html($this->template->render('subtask/remove', array( 'subtask' => $subtask, 'task' => $task, ))); }
CWE-639
9
public static function parseAndTrim($str, $isHTML = false) { //�Death from above�? � //echo "1<br>"; eDebug($str); // global $db; $str = str_replace("�", "&rsquo;", $str); $str = str_replace("�", "&lsquo;", $str); $str = str_replace("�", "&#174;", $str); $str = str_re...
CWE-89
0
public function getQueryGroupby() { $R1 = 'R1_' . $this->id; $R2 = 'R2_' . $this->id; return "$R2.value"; }
CWE-89
0
$banner->increaseImpressions(); } } // assign banner to the template and show it! assign_to_template(array( 'banners'=>$banners )); }
CWE-89
0
public function __construct () { self::$myBlogName = Options::v('sitename'); self::$myBlogUrl = Options::v('siteurl'); self::$myBlogUpdateUrl = Options::v('siteurl'); self::$myBlogRSSFeedUrl = Url::rss(); }
CWE-89
0
function manage () { expHistory::set('viewable', $this->params); $vendor = new vendor(); $vendors = $vendor->find('all'); if(!empty($this->params['vendor'])) { $purchase_orders = $this->purchase_order->find('all', 'vendor_id=' . $this->params['vendor']); } else { $purchase_orders = $this->purchas...
CWE-89
0
protected function remove($path, $force = false) { $stat = $this->stat($path); if (empty($stat)) { return $this->setError(elFinder::ERROR_RM, $path, elFinder::ERROR_FILE_NOT_FOUND); } $stat['realpath'] = $path; $this->rmTmb($stat); $this->clearcache(...
CWE-22
2
public function editspeed() { global $db; if (empty($this->params['id'])) return false; $calcname = $db->selectValue('shippingcalculator', 'calculator_name', 'id='.$this->params['id']); $calc = new $calcname($this->params['id']); assign_to_template(array( 'calculato...
CWE-89
0
public function uploadAvatar(Request $request) { $user = auth()->user(); if ($user && $request->hasFile('admin_avatar')) { $user->clearMediaCollection('admin_avatar'); $user->addMediaFromRequest('admin_avatar') ->toMediaCollection('admin_avatar'); ...
CWE-434
5
public function __construct() { self::$key = Options::v('google_captcha_sitekey'); self::$secret = Options::v('google_captcha_secret'); self::$lang = Options::v('google_captcha_lang'); }
CWE-89
0
foreach ($post['fields'] as $abs_pos => $field) { if ($current_cat != $post[$field . '_category']) { //reset position when category has changed $pos = 0; //set new current category $current_cat = $post[$field . '_category']; ...
CWE-79
1
foreach ($fields as $field => $title) { if($i==0 && $j==0){ echo '<div class="row">'; }elseif($i==0 && $j>0){ echo '</div><div class="row">'; } echo '<div class="col-md-6"><label class="checkbox-inline"><...
CWE-79
1
function access($attr, $path, $data, $volume) { return strpos(basename($path), '.') === 0 // if file/folder begins with '.' (dot) ? !($attr == 'read' || $attr == 'write') // set read+write to false, other (locked+hidden) set to true : null; // else elFinder decide i...
CWE-89
0
foreach ($evs as $key=>$event) { if ($condense) { $eventid = $event->id; $multiday_event = array_filter($events, create_function('$event', 'global $eventid; return $event->id === $eventid;')); if (!empty($multiday_event)) { ...
CWE-89
0
public function show() { $task = $this->getTask(); $subtask = $this->getSubtask(); $this->response->html($this->template->render('subtask_converter/show', array( 'subtask' => $subtask, 'task' => $task, ))); }
CWE-639
9
function unlockTables() { $sql = "UNLOCK TABLES"; $res = mysqli_query($this->connection, $sql); return $res; }
CWE-89
0
function import() { $pullable_modules = expModules::listInstalledControllers($this->baseclassname); $modules = new expPaginator(array( 'records' => $pullable_modules, 'controller' => $this->loc->mod, 'action' => $this->params['action'], 'order' ...
CWE-89
0
public static function type($id) { return Categories::type($id); }
CWE-89
0
function VerifyBlockedSchedule($columns,$course_period_id,$sec,$edit=false) { if($course_period_id!='new') { $cp_det_RET= DBGet(DBQuery("SELECT * FROM course_periods WHERE course_period_id=$course_period_id")); $cp_det_RET=$cp_det_RET[1]; $teacher=$cp_det_RET['TEACHER_ID']; $sectea...
CWE-22
2
public function updatePreferences(Codendi_Request $request) { $request->valid(new Valid_String('cancel')); if (!$request->exist('cancel')) { $job_id = $request->get($this->widget_id . '_job_id'); $sql = "UPDATE plugin_hudson_widget SET job_id=" . $job_id . " WHERE owner_i...
CWE-89
0
function scan($dir, $filter = '') { $path = FM_ROOT_PATH.'/'.$dir; $ite = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)); $rii = new RegexIterator($ite, "/(".$filter.")/i"); $files = array(); foreach ($rii as $file) { if (!$file->isDir()) { $fileName = $f...
CWE-22
2
foreach ($events as $event) { $extevents[$date][] = $event; }
CWE-89
0
public function testPutRoutes($uri, $expectedVersion, $expectedController, $expectedAction, $expectedId, $expectedCode) { $request = new Enlight_Controller_Request_RequestTestCase(); $request->setMethod('PUT'); $response = new Enlight_Controller_Response_ResponseTestCase(); $re...
CWE-601
11
function import() { $pullable_modules = expModules::listInstalledControllers($this->baseclassname); $modules = new expPaginator(array( 'records' => $pullable_modules, 'controller' => $this->loc->mod, 'action' => $this->params['action'], 'order' ...
CWE-89
0
$opt .= "<option value=\"{$key}\" title=\"".htmlspecialchars($value)."\" {$sel}>".htmlspecialchars($value)."</option>"; } return $opt; }
CWE-89
0
unset($k, $v); } } return self::$user; }
CWE-502
15
echo '<LANGUAGE>' . htmlentities($value_arr['LANGUAGE']) . '</LANGUAGE>'; foreach ($value_arr['ENROLLMENT_INFO'] as $eid => $ed) { echo '<ENROLLMENT_INFO_' . htmlentities($eid) . '>'; echo '<SCHOOL_ID>' . htmlentitie...
CWE-22
2
function edit_option_master() { expHistory::set('editable', $this->params); $params = isset($this->params['id']) ? $this->params['id'] : $this->params; $record = new option_master($params); assign_to_template(array( 'record'=>$record )); }
CWE-89
0
public function subscriptions() { global $db; expHistory::set('manageable', $this->params); // make sure we have what we need. if (empty($this->params['key'])) expQueue::flashAndFlow('error', gt('The security key for account was not supplied.')); if (empty($this->par...
CWE-89
0
public static function getCookieValue($value) { if (substr($value, 0, 1) !== '"' && substr($value, -1, 1) !== '"' && strpbrk($value, ';,=') ) { $value = '"' . $value . '"'; } return $value; }
CWE-89
0
public static function handler($vars) { self::$vars(); }
CWE-89
0
public function showall() { expHistory::set('viewable', $this->params); $limit = (isset($this->config['limit']) && $this->config['limit'] != '') ? $this->config['limit'] : 10; if (!empty($this->params['view']) && ($this->params['view'] == 'showall_accordion' || $this->params['view'] == 'show...
CWE-89
0
public function confirm() { $task = $this->getTask(); $subtask = $this->getSubtask(); $this->response->html($this->template->render('subtask/remove', array( 'subtask' => $subtask, 'task' => $task, ))); }
CWE-639
9
$attvalue = str_replace($quotchar, "", $attvalue); switch ($attname){ case 'background': $styledef .= "background-image: url('$trans_image_path'); "; break; case 'bgcolor': $has_bgc_stl = true; ...
CWE-89
0
public function showall() { expHistory::set('viewable', $this->params); // figure out if should limit the results if (isset($this->params['limit'])) { $limit = $this->params['limit'] == 'none' ? null : $this->params['limit']; } else { $limit = (isset($this->co...
CWE-89
0
public function load_from_resultset($rs) { $main = $rs[0]; $this->id = $main->id; $this->website = $main->website; $this->title = $main->title; $this->file = $main->file; $this->sections = mb_unserialize($main->sections); $this->gallery = $main->gallery; $this->comments = $ma...
CWE-22
2
public function confirm() { $task = $this->getTask(); $link = $this->getTaskLink(); $this->response->html($this->template->render('task_internal_link/remove', array( 'link' => $link, 'task' => $task, ))); }
CWE-639
9
function show_vendor () { $vendor = new vendor(); if(isset($this->params['id'])) { $vendor = $vendor->find('first', 'id =' .$this->params['id']); $vendor_title = $vendor->title; $state = new geoRegion($vendor->state); $vendor->state = $state->name; //Removed unnecessary fields unset( ...
CWE-89
0
public function confirm() { $task = $this->getTask(); $link = $this->getTaskLink(); $this->response->html($this->template->render('task_internal_link/remove', array( 'link' => $link, 'task' => $task, ))); }
CWE-639
9
$contents = ['form' => tep_draw_form('classes', 'tax_classes.php', 'page=' . $_GET['page'] . '&action=insert')];
CWE-79
1
public static function exist ($vars) { if(file_exists(GX_THEME.THEME.'/'.$vars.'.php')) { return true; }else{ return false; } }
CWE-89
0
public function testIdExceptionPhp53() { if (PHP_VERSION_ID >= 50400) { $this->markTestSkipped('Test skipped, for PHP 5.3 only.'); } $this->proxy->setActive(true); $this->proxy->setId('foo'); }
CWE-89
0
public function insert() { global $DB; $ok = $DB->execute(' INSERT INTO nv_menus (id, codename, icon, lid, notes, functions, enabled) VALUES ( 0, :codename, :icon, :lid, :notes, :functions, :enabled)', array( 'codename' => value_or_default($this->codename, ""), 'icon' =...
CWE-79
1
public function navigate_session() { global $website; global $user; global $DB; $fid = $_REQUEST['fid']; if(empty($fid)) $fid = 'dashboard'; $user_profile_name = $DB->query_single('name', 'nv_profiles', 'id='.protect($user->profile)); $this->add_content( '<div class="navigate-help"...
CWE-89
0
realname: l.attr('data-realname'), firstname: l.attr('data-firstname') }); l.append(` <div class="member-details"> ${member_item} ${l.attr('data-name') || `${membe...
CWE-79
1
function comment_item($params) { if (!user_can_access('module.comments.index')) { return; } $data = array( 'id' => $params['comment_id'], 'single' => true, ); $comment = get_comments($data); if (!$comment) { retu...
CWE-94
14
function wp_statistics_get_site_title( $url ) { //Get ody Page $html = wp_statistics_get_html_page( $url ); if ( $html === false ) { return false; } //Get Page Title if ( class_exists( 'DOMDocument' ) ) { $dom = new DOMDocument; @$dom->loadHTML( $html ); $title = ''; if ( isset( $dom ) and $dom->getEl...
CWE-79
1
public static function email_verification($email, $hash) { global $DB; $status = false; if(strpos($hash, "-") > 0) { list($foo, $expiry) = explode("-", $hash); if(time() > $expiry) { // expired unconfirmed account! return ...
CWE-89
0
function get_is_file($dir, $item) { // can this file be edited? return @is_file(get_abs_item($dir,$item)); }
CWE-22
2
public function __construct() { }
CWE-89
0
public function manage_sitemap() { global $db, $user, $sectionObj, $sections; expHistory::set('viewable', $this->params); $id = $sectionObj->id; $current = null; // all we need to do is determine the current section $navsections = $sections; if (...
CWE-89
0
public function buildControl() { $control = new colorcontrol(); if (!empty($this->params['value'])) $control->value = $this->params['value']; if ($this->params['value'][0] != '#') $this->params['value'] = '#' . $this->params['value']; $control->default = $this->params['value']; ...
CWE-89
0
public function redirect($url) { if (trim($url) == '') { return false; } $url = str_ireplace('Location:', '', $url); $url = trim($url); $redirectUrl = site_url(); $parseUrl = parse_url($url); if (isset($parseUrl['host'])) { if ($p...
CWE-93
33
foreach ($value as $i => $j) { $column_check = explode('_', $i); if ($column_check[0] == 'CUSTOM') { $check_validity = DBGet(DBQuery('SELECT COUNT(*) as REC_EX FROM school_custom_fields WHERE ID=' . $column_check[1] . ' AND (SCHOOL_ID=' ....
CWE-79
1