code
stringlengths
12
2.05k
label_name
stringlengths
6
8
label
int64
0
95
public function backup($type='json') { global $DB; global $website; $out = array(); $DB->query('SELECT * FROM nv_templates WHERE website = '.protect($website->id), 'object'); if($type='json') $out = json_encode($DB->result()); return $o...
CWE-89
0
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
$navs[$i]->link = expCore::makeLink(array('section' => $navs[$i]->id), '', $navs[$i]->sef_name); if (!$view) { // unset($navs[$i]); //FIXME this breaks jstree if we remove a parent and not the child $attr = new stdClass(); $attr->class = 'hidde...
CWE-89
0
function manage() { global $db; expHistory::set('manageable', $this->params); // $classes = array(); $dir = BASE."framework/modules/ecommerce/billingcalculators"; if (is_readable($dir)) { $dh = opendir($dir); while (($file = readdir($dh)) !== false) { ...
CWE-89
0
public static function parseAndTrimImport($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 = ...
CWE-89
0
public function update() { $project = $this->getProject(); $tag_id = $this->request->getIntegerParam('tag_id'); $tag = $this->tagModel->getById($tag_id); $values = $this->request->getValues(); list($valid, $errors) = $this->tagValidator->validateModification($values); ...
CWE-639
9
public function Recipient($to) { $this->error = null; // so no confusion is caused if(!$this->connected()) { $this->error = array( "error" => "Called Recipient() without being connected"); return false; } fputs($this->smtp_conn,"RCPT TO:<" . $to . ">" . $this->CRLF); $...
CWE-79
1
function edit_order_item() { $oi = new orderitem($this->params['id'], true, true); if (empty($oi->id)) { flash('error', gt('Order item doesn\'t exist.')); expHistory::back(); } $oi->user_input_fields = expUnserialize($oi->user_input_fields); $params['o...
CWE-89
0
function reset_stats() { // global $db; // reset the counters // $db->sql ('UPDATE '.$db->prefix.'banner SET impressions=0 WHERE 1'); banner::resetImpressions(); // $db->sql ('UPDATE '.$db->prefix.'banner SET clicks=0 WHERE 1'); banner::resetClicks(); /...
CWE-89
0
public function attachLink(Request $request) { $pageId = $request->get('attachment_link_uploaded_to'); try { $this->validate($request, [ 'attachment_link_uploaded_to' => 'required|integer|exists:pages,id', 'attachment_link_name' => 'required|string|mi...
CWE-79
1
function VerifyFixedSchedule($columns,$columns_var,$update=false) { $qr_teachers= DBGet(DBQuery('select TEACHER_ID,SECONDARY_TEACHER_ID from course_periods where course_period_id=\''.$_REQUEST['course_period_id'].'\'')); $teacher=($_REQUEST['tables']['course_periods'][$_REQUEST['course_period_id']]['TEACHE...
CWE-22
2
public function isMethodSafe() { return in_array($this->getMethod(), array('GET', 'HEAD')); }
CWE-89
0
public function approve_toggle() { global $history; if (empty($this->params['id'])) return; /* The global constants can be overriden by passing appropriate params */ //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet $r...
CWE-89
0
public static function getSName($zdb, $id, $wid = false, $wnick = false) { try { $select = $zdb->select(self::TABLE); $select->where(self::PK . ' = ' . $id); $results = $zdb->execute($select); $row = $results->current(); return self::getNameWi...
CWE-89
0
private function encloseForCSV($field) { return '"' . cleanCSV($field) . '"'; }
CWE-1236
12
public static function botlist() { $botlist = array( "Teoma", "alexa", "froogle", "inktomi", "looksmart", "URL_Spider_SQL", "Firefly", "NationalDirectory", ...
CWE-89
0
public function __construct(?string $message = null) { if ($message === null) { $message = _('Invalid email/password combination.'); } parent::__construct($message, 0); }
CWE-307
26
function html_operation_successful( $p_redirect_url, $p_message = '' ) { echo '<div class="success-msg">'; if( !is_blank( $p_message ) ) { echo $p_message . '<br />'; } echo lang_get( 'operation_successful' ).'<br />'; print_bracket_link( $p_redirect_url, lang_get( 'proceed' ) ); echo '</div>'; }
CWE-79
1
public function params() { $project = $this->getProject(); $values = $this->request->getValues(); if (empty($values['action_name']) || empty($values['project_id']) || empty($values['event_name'])) { $this->create(); return; } $action = $this->act...
CWE-639
9
public static function getId($id=''){ if(isset($id)){ $sql = sprintf("SELECT * FROM `menus` WHERE `id` = '%d' ORDER BY `order` ASC", $id); $menus = Db::result($sql); $n = Db::$num_rows; }else{ $menus = ''; } return $menus; ...
CWE-79
1
public function testGetEventsPublicProfile(){ TestingAuxLib::loadX2NonWebUser (); TestingAuxLib::suLogin ('testuser'); Yii::app()->settings->historyPrivacy = null; $lastEventId=0; $lastTimestamp=0; $myProfile = Profile::model()->findByAttributes(array('username' => '...
CWE-79
1
protected function deleteFileInStorage(Attachment $attachment) { $storage = $this->getStorage(); $dirPath = dirname($attachment->path); $storage->delete($attachment->path); if (count($storage->allFiles($dirPath)) === 0) { $storage->deleteDirectory($dirPath); ...
CWE-22
2
public function getQuerySelect() { return ''; }
CWE-89
0
public function remove() { $this->checkCSRFParam(); $project = $this->getProject(); $category = $this->getCategory(); if ($this->categoryModel->remove($category['id'])) { $this->flash->success(t('Category removed successfully.')); } else { $this->...
CWE-639
9
function update_option_master() { global $db; $id = empty($this->params['id']) ? null : $this->params['id']; $opt = new option_master($id); $oldtitle = $opt->title; $opt->update($this->params); // if the title of the master changed we should...
CWE-89
0
function edit_vendor() { $vendor = new vendor(); if(isset($this->params['id'])) { $vendor = $vendor->find('first', 'id =' .$this->params['id']); assign_to_template(array( 'vendor'=>$vendor )); } }
CWE-89
0
public function start() { if ($this->started) { return true; } $this->loadSession(); if (!$this->saveHandler->isWrapper() && !$this->saveHandler->isSessionHandlerInterface()) { // This condition matches only PHP 5.3 + internal save handlers $t...
CWE-89
0
public static function editor($mode = 'light'){ $editor = Options::v('use_editor'); if($editor == 'on'){ $GLOBALS['editor'] = true; }else{ $GLOBALS['editor'] = false; } if ($mode == 'light') { $GLOBALS['editor_mode'] = 'light'; ...
CWE-89
0
public function testGetEvents(){ TestingAuxLib::loadX2NonWebUser (); TestingAuxLib::suLogin ('admin'); Yii::app()->settings->historyPrivacy = null; $lastEventId = 0; $lastTimestamp = 0; $events = Events::getEvents ($lastEventId, $lastTimestamp, 4); $this->ass...
CWE-79
1
public function testComments() { $antiXss = new \MicroweberPackages\Helper\HTMLClean(); $string = '<a href="https://example.com">test</a>'; $content = $antiXss->onlyTags($string); $this->assertEquals($string, $content); }
CWE-79
1
public static function returnChildrenAsJSON() { global $db; //$nav = section::levelTemplate(intval($_REQUEST['id'], 0)); $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; $nav = $db->selectObjects('section', 'parent=' . $id, 'rank'); //FIXME $m...
CWE-89
0
function updateObject($object, $table, $where=null, $identifier='id', $is_revisioned=false) { if ($is_revisioned) { $object->revision_id++; //if ($table=="text") eDebug($object); $res = $this->insertObject($object, $table); //if ($table=="text") eDebug($objec...
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
function &getAll(&$dbh, $proposalId) { $sql = "SELECT *, UNIX_TIMESTAMP(timestamp) AS timestamp FROM package_proposal_votes WHERE pkg_prop_id = ". $dbh->quoteSmart($proposalId) ." ORDER BY timestamp ASC"; $res = $dbh->query($sql); if (DB::isError($res)) { return $res; ...
CWE-502
15
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
function update_optiongroup_master() { global $db; $id = empty($this->params['id']) ? null : $this->params['id']; $og = new optiongroup_master($id); $oldtitle = $og->title; $og->update($this->params); // if the title of the master changed we should update th...
CWE-89
0
public function confirm() { $task = $this->getTask(); $link_id = $this->request->getIntegerParam('link_id'); $link = $this->taskExternalLinkModel->getById($link_id); if (empty($link)) { throw new PageNotFoundException(); } $this->response->html($this...
CWE-639
9
function update_vendor() { $vendor = new vendor(); $vendor->update($this->params['vendor']); expHistory::back(); }
CWE-89
0
function verify(){ echo $_GET['challenge']; }
CWE-79
1
function info_application($bp_name, $bdd){ $sql = "select * from bp where name = '" . $bp_name . "'"; $req = $bdd->query($sql); $info = $req->fetch(); echo json_encode($info); }
CWE-78
6
protected function _joinPath($dir, $name) { return rtrim($dir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $name; }
CWE-78
6
function searchCategory() { return gt('Event'); }
CWE-89
0
public function setModel(Model $model) { $this->model = $model; $this->extensions = $this->model->getAllowedExtensions(); $this->from($this->model->getObjectTypeDirName()); return $this; }
CWE-79
1
public function attributeLabels() { return array( 'actionId' => Yii::t('actions','Action ID'), 'text' => Yii::t('actions','Action Text'), ); }
CWE-79
1
$evs = $this->event->find('all', "id=" . $edate->event_id . $featuresql); foreach ($evs as $key=>$event) { if ($condense) { $eventid = $event->id; $multiday_event = array_filter($events, create_function('$event', 'global $eventid; retur...
CWE-89
0
public function getQuerySelect() { // SubmittedOn is stored in the artifact return "a.submitted_by AS `" . $this->name . "`"; }
CWE-89
0
public function load_from_resultset($rs) { global $DB; $main = $rs[0]; $this->id = $main->id; $this->codename = $main->codename; $this->icon = $main->icon; $this->lid = $main->lid; $this->notes = $main->notes; $this->enabled = $main->enabled; ...
CWE-79
1
public function update_discount() { $id = empty($this->params['id']) ? null : $this->params['id']; $discount = new discounts($id); // find required shipping method if needed if ($this->params['required_shipping_calculator_id'] > 0) { $this->params['required_shipping_metho...
CWE-89
0
public function withPath($path) { if (!is_string($path)) { throw new \InvalidArgumentException( 'Invalid path provided; must be a string' ); } $path = $this->filterPath($path); if ($this->path === $path) { return $this; ...
CWE-89
0
public function AbbreviateHash($project, $hash) { if (!$project) return $hash; if (!(preg_match('/[0-9A-Fa-f]{40}/', $hash))) { return $hash; } $args = array(); $args[] = '-1'; $args[] = '--format=format:%h'; $args[] = $hash; $abbrevData = explode("\n", $this->exe->Execute($project->GetPath()...
CWE-78
6
function json_decode($json, $assoc=null) { return array(); }
CWE-918
16
$_fn[] = self::buildCondition($v, ' && '); } $fn[] = '('.\implode(' || ', $_fn).')'; break; case '$where': if (\is_callable($value)) { // need implementation ...
CWE-89
0
$logo = "<img src=\"".Options::get('siteurl').Options::get('logo')."\" style=\"width: $width; height: $height; margin: 1px;\">"; }else{ $logo = "<span class=\"mg genixcms-logo\"></span>"; } return $logo; }
CWE-79
1
foreach($functions as $function) { if($function->id == $f) { if($function->enabled=='1') $sortable_assigned[] = '<li class="ui-state-highlight" value="'.$function->id.'" category="'.$function->category.'"><img src="'.NAVIGATE_URL.'/'.$function->icon.'" align="absmiddle" /> '.t($function->lid, ...
CWE-79
1
function PMA_getErrorReportForm() { $html = ""; $html .= '<form action="error_report.php" method="post" name="report_frm"' . ' id="report_frm" class="ajax">' . '<fieldset style="padding-top:0px">'; $html .= '<p>' . __( 'phpMyAdmin has encountered an error. We have collected ...
CWE-79
1
public function confirm() { $project = $this->getProject(); $swimlane = $this->getSwimlane(); $this->response->html($this->helper->layout->project('swimlane/remove', array( 'project' => $project, 'swimlane' => $swimlane, ))); }
CWE-639
9
function move_standalone() { expSession::clearAllUsersSessionCache('navigation'); assign_to_template(array( 'parent' => $this->params['parent'], )); }
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
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
protected function _joinPath($dir, $name) { return rtrim($dir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $name; }
CWE-918
16
function nvweb_menu_load_actions() { global $DB; global $structure; global $current; global $website; if(empty($structure['actions'])) { $structure['actions'] = array(); $DB->query(' SELECT node_id, subtype, text FROM nv_webdictionary WHERE node_type = "structure" ...
CWE-89
0
function scan_page($parent_id) { global $db; $sections = $db->selectObjects('section','parent=' . $parent_id); $ret = ''; foreach ($sections as $page) { $cLoc = serialize(expCore::makeLocation('container','@section' . $page->id)); ...
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-79
1
public function remove() { $this->checkCSRFParam(); $project = $this->getProject(); $tag_id = $this->request->getIntegerParam('tag_id'); $tag = $this->tagModel->getById($tag_id); if ($tag['project_id'] != $project['id']) { throw new AccessForbiddenException()...
CWE-639
9
function send_feedback() { $success = false; if (isset($this->params['id'])) { $ed = new eventdate($this->params['id']); // $email_addrs = array(); if ($ed->event->feedback_email != '') { $msgtemplate = expTemplate::get_template_for_action($th...
CWE-89
0
public function update() { global $DB; $ok = $DB->execute(' UPDATE nv_menus SET codename = :codename, icon = :icon, lid = :lid, notes = :notes, functions = :functions, enabled = :enabled WHERE id = :id', array( 'id' => $this->id, 'codename' => value_or...
CWE-79
1
public function saveConfig() { if (!empty($this->params['aggregate']) || !empty($this->params['pull_rss'])) { if ($this->params['order'] == 'rank ASC') { expValidator::failAndReturnToForm(gt('User defined ranking is not allowed when aggregating or pull RSS data feeds.'), $this->...
CWE-89
0
$sloc = expCore::makeLocation('navigation', null, $section->id); // remove any manage permissions for this page and it's children // $db->delete('userpermission', "module='navigationController' AND internal=".$section->id); // $db->delete('grouppermission', "module='na...
CWE-89
0
function select_string($n) { if (!is_int($n)) { throw new InvalidArgumentException( "Select_string only accepts integers: " . $n); } $string = $this->get_plural_forms(); $string = str_replace('nplurals',"\$total",$string); $string = str_replace("n",$n,$string); $string = str_repl...
CWE-94
14
function update_optiongroup_master() { global $db; $id = empty($this->params['id']) ? null : $this->params['id']; $og = new optiongroup_master($id); $oldtitle = $og->title; $og->update($this->params); // if the title of the master changed we should update th...
CWE-89
0
public static function update_object_score($object, $object_id) { global $DB; list($votes, $score) = webuser_vote::calculate_object_score($object, $object_id); $table = array( 'item' => 'nv_items', 'structure' => 'nv_structure', 'product' => 'nv_products' ); if(empty($table[$object...
CWE-89
0
$files[$key]->save(); } // eDebug($files,true); }
CWE-89
0
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...
CWE-22
2
}elseif($p->group == 3){ $grp = AUTHOR; }elseif($p->group == 4){
CWE-89
0
public function getPurchaseOrderByJSON() { if(!empty($this->params['vendor'])) { $purchase_orders = $this->purchase_order->find('all', 'vendor_id=' . $this->params['vendor']); } else { $purchase_orders = $this->purchase_order->find('all'); } echo json_encode($purchase_orders); }
CWE-89
0
public static function evaluate_search_tree($tree, $join = 'AND', $callback) { $matches = false; foreach($tree as $i => $el) { $b = false; if($i === 'AND' || $i === 'OR') { $b = self::evaluate_search_tree($el, $i, $callback); } else if(isset($el['query'])) { $b = call_user_func($callb...
CWE-79
1
protected function defaultExtensions() { return [ 'jpg', 'jpeg', 'bmp', 'png', 'webp', 'gif', 'svg', 'js', 'map', 'ico', 'css', 'less', 'scss', ...
CWE-22
2
function singleQuoteReplace($param1 = false, $param2 = false, $param3) { return str_replace("'", "''", str_replace("\'", "'", $param3)); }
CWE-79
1
public function getPurchaseOrderByJSON() { if(!empty($this->params['vendor'])) { $purchase_orders = $this->purchase_order->find('all', 'vendor_id=' . $this->params['vendor']); } else { $purchase_orders = $this->purchase_order->find('all'); } echo json_encode($purchase_orders); }
CWE-89
0
self::$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME); return self::$mysqli; } }
CWE-89
0
public function showUnpublished() { expHistory::set('viewable', $this->params); // setup the where clause for looking up records. $where = parent::aggregateWhereClause(); $where = "((unpublish != 0 AND unpublish < ".time().") OR (publish > ".time().")) AND ".$where; ...
CWE-89
0
public function dump($value) { $dumper = $this->getDumper(); if ($dumper) { // re-use the same DumpOutput instance, so it won't re-render the global styles/scripts on each dump. // exclude verbose information (e.g. exception stack traces) if (class_exists('Sy...
CWE-79
1
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-22
2
public function getQueryGroupby() { return ''; }
CWE-89
0
return $fa->nameGlyph($icons, 'icon-'); } } else { return array(); } }
CWE-89
0
public function approve() { expHistory::set('editable', $this->params); /* The global constants can be overriden by passing appropriate params */ //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet // $require_login = empty($this->params['requi...
CWE-89
0
function edit_section() { global $db, $user; $parent = new section($this->params['parent']); if (empty($parent->id)) $parent->id = 0; assign_to_template(array( 'haveStandalone' => ($db->countObjects('section', 'parent=-1') && $parent->id >= 0), 'paren...
CWE-89
0
$contents = ['form' => tep_draw_form('specials', 'specials.php', 'page=' . $_GET['page'] . '&sID=' . $sInfo->specials_id . '&action=deleteconfirm')];
CWE-79
1
public function destroy($id) { $sql = 'DELETE FROM plugin_hudson_widget WHERE id = ' . $id . ' AND owner_id = ' . $this->owner_id . " AND owner_type = '" . $this->owner_type . "'"; db_query($sql); }
CWE-89
0
public static function activate($thm) { if (Options::update('themes', $thm)) { new Options(); return true; }else{ return false; } }
CWE-89
0
function sell_media_ecommerce_enabled( $post_id ) { $status = true; $meta = get_post_meta( $post_id, 'sell_media_enable_ecommerce', true ); if ( class_exists( 'VS_Platform' ) && 0 === $meta ) { $status = false; } return $status; }
CWE-79
1
public function approve_toggle() { if (empty($this->params['id'])) return; /* The global constants can be overriden by passing appropriate params */ //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet // $require_login = empty($this->params['re...
CWE-89
0
foreach ($allowedFolders as $folder) { if ('/' . $folder === substr($uri, 0, 1 + strlen($folder))) { header('Content-Type: ' . $this->getMime($filePath)); readfile($filePath); return true; } }
CWE-79
1
throw new \InvalidArgumentException( 'URI must be a string or Psr\Http\Message\UriInterface' ); } $this->method = strtoupper($method); $this->uri = $uri; $this->setHeaders($headers); $this->protocol = $protocolVersion; $host = $ur...
CWE-89
0
public function post_prop () { $file = urldecode (join ('/', func_get_args ())); if (! FileManager::verify_file ($file)) { return $this->error (__ ('Invalid file name')); } // handle multiple properties at once if (isset ($_POST['props'])) { if (! is_array ($_POST['props'])) { return $this->erro...
CWE-434
5
protected function _add_log_attachment( $action, $attachment_id ) { $post = get_post( $attachment_id ); aal_insert_log( array( 'action' => $action, 'object_type' => 'Attachment', 'object_subtype' => $post->post_type, 'object_id' => $attachment_id, 'object_name' => get_the_title( ...
CWE-79
1
$tags = array_merge($matches[1], $tags); } $tags = array_unique($tags); return $tags; }
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...
CWE-22
2
protected function redirectToGroup(Thread $thread, $group_id) { if ($thread->state != Thread::STATE_CHATTING) { // We can redirect only threads which are in proggress now. return false; } // Redirect the thread $thread->state = Thread::STATE_WAITING; ...
CWE-79
1
foreach ($allusers as $uid) { $u = user::getUserById($uid); expPermissions::grant($u, 'manage', $sloc); }
CWE-89
0