code
stringlengths
12
2.05k
label_name
stringlengths
6
8
label
int64
0
95
protected function getComment() { $comment = $this->commentModel->getById($this->request->getIntegerParam('comment_id')); if (empty($comment)) { throw new PageNotFoundException(); } if (! $this->userSession->isAdmin() && $comment['user_id'] != $this->userSession->ge...
CWE-639
9
public function AddReplyTo($address, $name = '') { return $this->AddAnAddress('Reply-To', $address, $name); }
CWE-79
1
function db_start() { global $DatabaseServer, $DatabaseUsername, $DatabasePassword, $DatabaseName, $DatabasePort, $DatabaseType; switch ($DatabaseType) { case 'mysqli': $connection = new mysqli($DatabaseServer, $DatabaseUsername, $DatabasePassword, $DatabaseName, $DatabasePort); ...
CWE-79
1
function PMA_countLines($filename) { global $LINE_COUNT; if (defined('LINE_COUNTS')) { return $LINE_COUNT[$filename]; } // ensure that the file is inside the phpMyAdmin folder $depath = 1; foreach (explode('/', $filename) as $part) { if ($part == '..') { $depath--; ...
CWE-22
2
function db_properties($table) { global $DatabaseType, $DatabaseUsername; switch ($DatabaseType) { case 'mysqli': $result = DBQuery("SHOW COLUMNS FROM $table"); while ($row = db_fetch_row($result)) { $properties[strtoupper($row['FIELD'])]['TYPE'] = strtoupper($ro...
CWE-22
2
public static function incFront($vars, $param='') { $file = GX_PATH.'/inc/lib/Control/Frontend/'.$vars.'.control.php'; if ( file_exists($file) ) { # code... include($file); }else{ self::error('404'); } }
CWE-89
0
public function testGetDropdownValue($params, $expected, $session_params = []) { $this->login(); $bkp_params = []; //set session params if any if (count($session_params)) { foreach ($session_params as $param => $value) { if (isset($_SESSION[$param])) { $bk...
CWE-639
9
static function convertUTF($string) { return $string = str_replace('?', '', htmlspecialchars($string, ENT_IGNORE, 'UTF-8')); }
CWE-89
0
$text = preg_replace($exp, '', $text); } // Primary expression to filter out tags $exp = '/(?:^|\s|\.)(#\w+[-\w]+\w+|#\w+)(?:$|[^\'"])/u'; $matches = array(); preg_match_all($exp, $text, $matches); return $matches; }
CWE-79
1
function update_upcharge() { $this->loc->src = "@globalstoresettings"; $config = new expConfig($this->loc); $this->config = $config->config; //This will make sure that only the country or region that given a rate value will be saved in the db $upcharge = array(); foreach($this->params['upch...
CWE-89
0
static function description() { return gt("This module is for managing categories in your store."); }
CWE-89
0
public function confirm() { $project = $this->getProject(); $tag_id = $this->request->getIntegerParam('tag_id'); $tag = $this->tagModel->getById($tag_id); $this->response->html($this->template->render('project_tag/remove', array( 'tag' => $tag, 'proje...
CWE-639
9
public function downloadfile() { if (empty($this->params['fileid'])) { flash('error', gt('There was an error while trying to download your file. No File Specified.')); expHistory::back(); } $fd = new filedownload($this->params['fileid']); if (empty(...
CWE-89
0
protected function _mkfile($path, $name) { $path = $this->_joinPath($path, $name); return $this->connect->put($path, '') ? $path : false; /* if ($this->tmp) { $path = $this->_joinPath($path, $name); $local = $this->getTempFile(); $res = touch($local) &...
CWE-78
6
static function isSearchable() { return true; }
CWE-89
0
function get_file($file) { $files['radiusd'] = FREERADIUS_RADDB . "/radiusd.conf"; $files['eap'] = FREERADIUS_MODSENABLED . "/eap"; $files['sql'] = FREERADIUS_MODSENABLED . "/sql"; $files['clients'] = FREERADIUS_RADDB . "/clients.conf"; $files['users'] = FREERADIUS_RADDB . "/users"; $files['macs'] = FREERADIUS_RA...
CWE-79
1
public function getPageData() { $data = parent::getPageData(); $data['menu'] = 'admin'; $data['showonmenu'] = false; $data['title'] = 'options'; $data['icon'] = 'fas fa-wrench'; return $data; }
CWE-79
1
public function __toString() { return self::createUriString( $this->scheme, $this->getAuthority(), $this->getPath(), $this->query, $this->fragment ); }
CWE-89
0
function edit_internalalias() { $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
static function displayname() { return gt("e-Commerce Category Manager"); }
CWE-89
0
public function confirm() { $project = $this->getProject(); $tag_id = $this->request->getIntegerParam('tag_id'); $tag = $this->tagModel->getById($tag_id); $this->response->html($this->template->render('project_tag/remove', array( 'tag' => $tag, 'proje...
CWE-639
9
public function manage() { expHistory::set('manageable', $this->params); // build out a SQL query that gets all the data we need and is sortable. $sql = 'SELECT b.*, c.title as companyname, f.expfiles_id as file_id '; $sql .= 'FROM '.DB_TABLE_PREFIX.'_banner b, '.DB_TABLE_P...
CWE-89
0
foreach($image->expTag as $tag) { if (isset($used_tags[$tag->id])) { $used_tags[$tag->id]->count++; } else { $exptag = new expTag($tag->id); $used_tags[$tag->id] = $exptag; $used_tags[$tag->id]->c...
CWE-89
0
public function backup($type='json') { global $DB; global $website; $DB->query('SELECT * FROM nv_brands WHERE website = '.protect($website->id), 'object'); $out = $DB->result(); if($type='json') $out = json_encode($out); return $out; ...
CWE-89
0
function searchName() { return gt('Webpage'); }
CWE-89
0
function edit_internalalias() { $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
protected function getC3Service() { include_once $this->targetDirs[1].'/includes/HotPath/C3.php'; return $this->services['Symfony\Component\DependencyInjection\Tests\Fixtures\includes\HotPath\C3'] = new \Symfony\Component\DependencyInjection\Tests\Fixtures\includes\HotPath\C3(); }
CWE-89
0
$file_link = explode(" ", trim($row['file']))[0]; // If the link has no "http://" in front, then add it if (substr(strtolower($file_link), 0, 4) !== 'http') { $file_link = 'http://' . $file_link; } echo '<td><a href="htt...
CWE-79
1
$alt = __esc('Export'); } if ($force_type != 'import' && $force_type != 'export' && $force_type != 'save' && $cancel_url != '') { $cancel_action = "<input type='button' onClick='cactiReturnTo(\"" . htmlspecialchars($cancel_url) . "\")' value='" . $calt . "'>"; } else { $cancel_action = ''; } ?> <table sty...
CWE-79
1
public function pending() { // global $db; // make sure we have what we need. if (empty($this->params['id'])) expQueue::flashAndFlow('error', gt('Your subscriber ID was not supplied.')); // find the subscriber and their pending subscriptions $ealerts = expeAlerts::ge...
CWE-89
0
public function remove() { $project = $this->getProject(); $this->checkCSRFParam(); $column_id = $this->request->getIntegerParam('column_id'); if ($this->columnModel->remove($column_id)) { $this->flash->success(t('Column removed successfully.')); } else { ...
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
protected function _chmod($path, $mode) { $modeOct = is_string($mode) ? octdec($mode) : octdec(sprintf("%04o",$mode)); return @ftp_chmod($this->connect, $modeOct, $path); }
CWE-89
0
public static function loader(){ $theme = Options::v('themes'); define('THEME', $theme); self::incFunc($theme); }
CWE-89
0
public function getAdminViewItemLink($icmsObj, $onlyUrl=false, $withimage=false) { $ret = $this->handler->_moduleUrl . "admin/" . $this->handler->_page . "?op=view&amp;" . $this->handler->keyName . "=" . $icmsObj->getVar($this->handler->keyName); if ($onlyUrl) { return $ret; } elseif ($withima...
CWE-22
2
public function testIdExceptionPhp54() { session_start(); $this->proxy->setId('foo'); }
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
$loc = expCore::makeLocation('navigation', '', $standalone->id); if (expPermissions::check('manage', $loc)) return true; } return false; }
CWE-89
0
} elseif ($this->isValidOrderKey($o)) { $this->orderKey[] = '`' . $o . '`'; } } }
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
function rsvpmaker_stripecharge( $atts ) { if ( is_admin() || wp_is_json_request() ) { return; } global $current_user; $vars['description'] = ( ! empty( $atts['description'] ) ) ? $atts['description'] : __( 'charge from', 'rsvpmaker' ) . ' ' . get_bloginfo( 'name' ); $vars['paymentType'] = $paymentType = ( ...
CWE-89
0
function GETPOST($paramname,$check='',$method=0) { if (empty($method)) $out = isset($_GET[$paramname])?$_GET[$paramname]:(isset($_POST[$paramname])?$_POST[$paramname]:''); elseif ($method==1) $out = isset($_GET[$paramname])?$_GET[$paramname]:''; elseif ($method==2) $out = isset($_POST[$paramname])?$_POST[$paramname]...
CWE-22
2
$contents = ['form' => tep_draw_form('status', 'orders_status.php', 'page=' . $_GET['page'] . '&action=insert')];
CWE-79
1
private static function createUriString($scheme, $authority, $path, $query, $fragment) { $uri = ''; if (!empty($scheme)) { $uri .= $scheme . ':'; } $hierPart = ''; if (!empty($authority)) { if (!empty($scheme)) { $hierPart .= '//...
CWE-89
0
public function setLoggerChannel($channel = 'Organizr', $username = null) { if ($this->hasDB()) { $setLogger = false; if ($username) { $username = htmlspecialchars($username); } if ($this->logger) { if ($channel) { if (strtolower($this->logger->getChannel()) !== strtolower($channel)) { ...
CWE-79
1
function can_process() { $Auth_Result = hook_authenticate($_SESSION['wa_current_user']->username, $_POST['cur_password']); if (!isset($Auth_Result)) // if not used external login: standard method $Auth_Result = get_user_auth($_SESSION['wa_current_user']->username, md5($_POST['cur_password'])); if (!$Auth_Result...
CWE-359
32
public function withUri(UriInterface $uri, $preserveHost = false) { if ($uri === $this->uri) { return $this; } $new = clone $this; $new->uri = $uri; if (!$preserveHost) { if ($host = $uri->getHost()) { $new->updateHostFromUri($hos...
CWE-89
0
foreach ($page as $pageperm) { if (!empty($pageperm['manage'])) return true; }
CWE-89
0
public function Connect($host, $port = 0, $tval = 30) { // set the error val to null so there is no confusion $this->error = null; // make sure we are __not__ connected if($this->connected()) { // already connected, generate error $this->error = array("error" => "Already connected to a se...
CWE-79
1
public function whereFileName($fileName) { $this->selectSingle = $this->model->getFileNameParts($fileName); return $this; }
CWE-79
1
public function __construct(PromotionGatewayInterface $gateway, PromotionItemBuilder $itemBuilder) { $this->gateway = $gateway; $this->itemBuilder = $itemBuilder; $this->requiredDalAssociations = [ 'personaRules', 'personaCustomers', 'cartRules', ...
CWE-79
1
static function getParentGroup($group_id) { global $user; $mdb2 = getConnection(); $sql = "select parent_id from tt_groups where id = $group_id and org_id = $user->org_id and status = 1"; $res = $mdb2->query($sql); if (!is_a($res, 'PEAR_Error')) { $val = $res->fetchRow(); return $va...
CWE-89
0
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
function get_filedisplay_views() { expTemplate::get_filedisplay_views(); $paths = array( BASE.'framework/modules/common/views/file/', BASE.'themes/'.DISPLAY_THEME.'modules/common/views/file/', ); $views = array(); foreach ($paths as $path) { if (is_readable($path)) { ...
CWE-89
0
foreach ($days as $value) { $regitem[] = $value; }
CWE-89
0
public function handle($request, Closure $next) { view()->share('cspNonce', $this->cspService->getNonce()); if ($this->cspService->allowedIFrameHostsConfigured()) { config()->set('session.same_site', 'none'); } $response = $next($request); $this->cspService-...
CWE-79
1
$module_views[$key]['name'] = gt($value['name']); } // look for a config form for this module's current view // $controller->loc->mod = expModules::getControllerClassName($controller->loc->mod); //check to see if hcview was passed along, indicating a hard-coded module // if (!empty($contr...
CWE-89
0
function setParameter($a_name, $a_value) { $this->parameters[$a_name] = $a_value; }
CWE-79
1
public function load_from_post() { if(intval($_REQUEST['parent'])!=$this->id) // protection against selecting this same category as parent of itself { $this->parent = intval($_REQUEST['parent']); } $this->template = $_REQUEST['template']; $this->access = intval($_REQU...
CWE-79
1
protected function _mkdir($path, $name) { $path = $this->_joinPath($path, $name); if (ftp_mkdir($this->connect, $path) === false) { return false; } $this->options['dirMode'] && @ftp_chmod($this->connect, $this->options['dirMode'], $path); return $path; }
CWE-89
0
$property->value[$lang] = theme::import_sample_translate_nv_urls($pvalue, $structure, $items); } } else if(!is_string($property->value)) // ignore numeric values { $property->val...
CWE-89
0
private function getTaskLink() { $link = $this->taskLinkModel->getById($this->request->getIntegerParam('link_id')); if (empty($link)) { throw new PageNotFoundException(); } return $link; }
CWE-639
9
function mso_url_get() { $CI = &get_instance(); if (isset($_SERVER['REQUEST_URI']) and $_SERVER['REQUEST_URI'] and (strpos($_SERVER['REQUEST_URI'], '?') !== FALSE)) { $url = getinfo('site_protocol') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $url = str_replace($CI->config->config['base_url'], "", $ur...
CWE-79
1
public function __viewIndex() { $this->setPageType('table'); $this->setTitle(__('%1$s &ndash; %2$s', array(__('Pages'), __('Symphony')))); $nesting = Symphony::Configuration()->get('pages_table_nest_children', 'symphony') == 'yes'; if ($nesting && isset($_GET['parent']) && is_n...
CWE-79
1
public function link($target, $link) { if (! windows_os()) { return symlink($target, $link); } $mode = $this->isDirectory($target) ? 'J' : 'H'; exec("mklink /{$mode} \"{$link}\" \"{$target}\""); }
CWE-78
6
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
public function actionGetItems(){ $model = X2Model::model ($this->modelClass); if (isset ($model)) { $tableName = $model->tableName (); $sql = 'SELECT id, subject as value FROM '.$tableName.' WHERE subject LIKE :qterm ORDER BY subject ASC'; ...
CWE-79
1
public function confirm() { $project = $this->getProject(); $this->response->html($this->helper->layout->project('action/remove', array( 'action' => $this->actionModel->getById($this->request->getIntegerParam('action_id')), 'available_events' => $this->eventManager->getA...
CWE-639
9
public function confirm() { $project = $this->getProject(); $this->response->html($this->helper->layout->project('column/remove', array( 'column' => $this->columnModel->getById($this->request->getIntegerParam('column_id')), 'project' => $project, ))); }
CWE-639
9
public function getSimilar($id){ $url = "http://api.themoviedb.org/3/movie/{$id}/similar?api_key=".$this->apikey; $similar = $this->curl($url); return $similar; }
CWE-89
0
$this->subtaskTimeTrackingModel->logEndTime($subtaskId, $this->userSession->getId()); $this->subtaskTimeTrackingModel->updateTaskTimeTracking($task['id']); }
CWE-639
9
public function save($check_notify = false) { if (isset($_POST['email_recipients']) && is_array($_POST['email_recipients'])) { $this->email_recipients = base64_encode(serialize($_POST['email_recipients'])); } return parent::save($check_notify); }
CWE-89
0
public function search_external() { // global $db, $user; global $db; $sql = "select DISTINCT(a.id) as id, a.source as source, a.firstname as firstname, a.middlename as middlename, a.lastname as lastname, a.organization as organization, a.email as email "; $sql .= "from " . $db->pref...
CWE-89
0
function SafeStripSlashes($string) { return (get_magic_quotes_gpc() ? stripslashes($string) : $string); }
CWE-79
1
public function duplicate($hash, $suffix='copy') { if ($this->commandDisabled('duplicate')) { return $this->setError(elFinder::ERROR_COPY, '#'.$hash, elFinder::ERROR_PERM_DENIED); } if (($file = $this->file($hash)) == false) { return $this->setError(elFinder::ERROR_COPY, elFinder::ERROR_FILE_NOT_FOUND);...
CWE-89
0
public function getLatest(){ $url = "http://api.themoviedb.org/3/movie/latest?api_key=".$this->apikey; $latest = $this->curl($url); return $latest; }
CWE-89
0
public static function load($mod) { $file = GX_MOD."/".$mod."/index.php"; if(file_exists($file)){ include ($file); } }
CWE-89
0
foreach ($day as $extevent) { $event_cache = new stdClass(); $event_cache->feed = $extgcalurl; $event_cache->event_id = $extevent->event_id; $event_cache->title = $extevent->title; ...
CWE-89
0
public function backup($type='json') { global $DB; global $website; $out = array(); $DB->query('SELECT * FROM nv_websites WHERE id = '.protect($website->id), 'object'); if($type='json') $out = json_encode($DB->result()); return $out; ...
CWE-89
0
foreach ( $metric_group_members as $index => $metric_name ) { print " <A HREF=\"./graph_all_periods.php?mobile=1&" . $g_metrics[$metric_name]['graph'] . "\"> <IMG BORDER=0 ALT=\"$clustername\" SRC=\"./graph.php?" . $g_metrics[$metric_name]['graph'] . "\"></A>"; }
CWE-79
1
function dashboard_panel_top_pages($params) { global $DB; global $website; $stats = &$params['statistics']; $navibars = &$params['navibars']; /* TOP PAGES */ $sql = ' SELECT i.views as page_views, i.id as id_item, i.category as id_category, p.views as path_views, p.path as path ...
CWE-89
0
$doRegist = (strpos($cmd, '*') !== false); if (! $doRegist) { $_getcmd = create_function('$cmd', 'list($ret) = explode(\'.\', $cmd);return trim($ret);'); $doRegist = ($_reqCmd && in_array($_reqCmd, array_map($_getcmd, explode(' ', $cmd)))); } if ($doRegist) { if (! is_array($handlers) || ...
CWE-89
0
public static function latestVersion () { $check = json_decode(Options::v('system_check'), true); $now = strtotime(date("Y-m-d H:i:s")); if (isset($check['last_check']) ) { $limit = $now - $check['last_check']; if ($limit < 86400) { $v...
CWE-89
0
function details($selected_events, $queue) { global $database_ged; // get all needed infos into variables $value_parts = explode(":", $selected_events); $id = $value_parts[0]; $ged_type = $value_parts[1]; $sql = "SELECT * FROM ".$ged_type."_queue_".$queue." WHERE id = $id"; $result = sqlrequest($database_ged, ...
CWE-78
6
public function __construct(public Request $Request, public SessionInterface $Session, public Config $Config, public Logger $Log, public Csrf $Csrf) { $flashBag = $this->Session->getBag('flashes'); // add type check because SessionBagInterface doesn't have get(), only FlashBag has it if ...
CWE-307
26
public static function update($vars) { if(is_array($vars)){ //print_r($vars); $u = $vars['user']; $sql = array( 'table' => 'user', 'id' => $vars['id'], 'key' => $u, ...
CWE-89
0
function HackingLog() { echo "" . _youReNotAllowedToUseThisProgram . "! " . _thisAttemptedViolationHasBeenLoggedAndYourIpAddressWasCaptured . "."; Warehouse('footer'); if ($_SERVER['HTTP_X_FORWARDED_FOR']) { $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; } else { $ip = $_SERVER['REMOTE_ADDR']; } if ($openSISNotify...
CWE-79
1
static function convertUTF($string) { return $string = str_replace('?', '', htmlspecialchars($string, ENT_IGNORE, 'UTF-8')); }
CWE-89
0
public function __construct() { $this->pop_conn = 0; $this->connected = false; $this->error = null; }
CWE-79
1
public static function avatar($id){ $usr = Db::result( sprintf("SELECT * FROM `user_detail` WHERE `id` = '%d' OR `userid` = '%s' LIMIT 1", Typo::int($id), Typo::cleanX($id) ) ); return $usr[0]->avatar; }
CWE-89
0
foreach($gc as $gcc=>$gcd) { if($gcd!='' && $gcc!='GRADE_LEVEL') { $sql_columns[]=$gcc; $sql_values[]="'".$gcd."'"; } if($gcd!='' && $gcc=='GRAD...
CWE-79
1
public static function BBCode2Html($text) { $text = trim($text); $text = self::parseEmoji($text); // Smileys to find... $in = array( ); // And replace them by... $out = array( ); $in[] = '[/*]'; $in[] = '[*]'; $out[] = '</li...
CWE-79
1
public function save() { $project = $this->getProject(); $values = $this->request->getValues(); list($valid, $errors) = $this->categoryValidator->validateCreation($values); if ($valid) { if ($this->categoryModel->create($values) !== false) { $this->f...
CWE-639
9
$date->delete(); // event automatically deleted if all assoc eventdates are deleted } expHistory::back(); }
CWE-89
0
function wp_embed_handler_youtube( $matches, $attr, $url, $rawattr ) { global $wp_embed; $embed = $wp_embed->autoembed( "https://youtube.com/watch?v={$matches[2]}" ); /** * Filters the YoutTube embed output. * * @since 4.0.0 * * @see wp_embed_handler_youtube() * * @param string $embed YouTube embed ...
CWE-79
1
public static function admin($var, $data='') { if (isset($data)) { # code... $GLOBALS['data'] = $data; } include(GX_PATH.'/gxadmin/themes/'.$var.'.php'); }
CWE-89
0
$row_rub = sql_fetsel("id_rubrique", "spip_rubriques", "lang='" . $GLOBALS['spip_lang'] . "' AND id_parent=$id_parent"); if ($row_rub) { $row['id_rubrique'] = $row_rub['id_rubrique']; } } } } return $row; }
CWE-79
1
public function theme_switch() { if (!expUtil::isReallyWritable(BASE.'framework/conf/config.php')) { // we can't write to the config.php file flash('error',gt('The file /framework/conf/config.php is NOT Writeable. You will be unable to change the theme.')); } expSettings::change('D...
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
function edit_freeform() { $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