code
stringlengths
12
2.05k
label_name
stringlengths
6
8
label
int64
0
95
public function clearTags() { $this->_tags = array(); // clear tag cache return (bool) CActiveRecord::model('Tags')->deleteAllByAttributes(array( 'type' => get_class($this->getOwner()), 'itemId' => $this->getOwner()->id) ); }
CWE-79
1
protected function imgCrop($path, $width, $height, $x, $y, $destformat = null, $jpgQuality = null) { if (($s = @getimagesize($path)) == false) { return false; } $result = false; if (!$jpgQuality) { $jpgQuality = $this->options['jpgQuality']; } switch ($this->imgLib) { case 'imagick': ...
CWE-89
0
function nvweb_content_comments_count($object_id = NULL, $object_type = "item") { global $DB; global $website; global $current; $element = $current['object']; if($current['type']=='structure' && $object_type == "item") $element = $element->elements(0); // item = structure->elements(first) ...
CWE-89
0
function create_thumbs($updir, $img, $name, $thumbnail_width, $thumbnail_height, $quality){ $arr_image_details = GetImageSize("$updir/$img"); $original_width = $arr_image_details[0]; $original_height = $arr_image_details[1]; $a = $thumbnail_width / $thumbnail_height; $b = $original_width / $original_height; ...
CWE-434
5
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
final public function modifyLimitQuery($query, $limit, $offset = 0) { if ($offset < 0) { throw new Exception(sprintf( 'Offset must be a positive integer or zero, %d given', $offset )); } if ($offset > 0 && ! $this->supportsLimitOff...
CWE-89
0
$src = substr($ref->source, strlen($prefix)) . $section->id; if (call_user_func(array($ref->module, 'hasContent'))) { $oloc = expCore::makeLocation($ref->module, $ref->source); $nloc = expCore::makeLocation($ref->module, $src); if ($ref->module...
CWE-89
0
static function searchUser(AuthLDAP $authldap) { if (self::connectToServer($authldap->getField('host'), $authldap->getField('port'), $authldap->getField('rootdn'), Toolbox::decrypt($authldap->getField('rootdn_passwd'), GLPIKEY), ...
CWE-798
18
return $fa->nameGlyph($icons, 'icon-'); } } else { return array(); } }
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 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 function getErrorMessage() { $vs_error_message = $this->opo_error_messages->get($this->opn_error_number); if ($vs_error_message) { return $vs_error_message; } else { return "Unknown error: ".$this->opn_error_number; } }
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 html() { switch( $this->type ) { case FILE_ADDED: $t_string = 'timeline_issue_file_added'; break; case FILE_DELETED: $t_string = 'timeline_issue_file_deleted'; break; default: throw new ServiceException( 'Unknown Event Type', ERROR_GENERIC ); } $t_bug_link = string_g...
CWE-79
1
$name = ucfirst($module->name); if (in_array($name, $skipModules)) { continue; } if($name != 'Document'){ $controllerName = $name.'Controller'; if(file_exists('protected/modules/'.$module->name.'/controllers/'.$controllerNam...
CWE-79
1
private function getResponse ($size = 128) { $pop3_response = fgets($this->pop_conn, $size); return $pop3_response; }
CWE-79
1
public function getDisplayName ($plural=true) { return Yii::t('contacts', '{contact} List|{contact} Lists', array( (int) $plural, '{contact}' => Modules::displayName(false, 'Contacts'), )); }
CWE-79
1
$res = preg_match("/^$map_part/", $this->url_parts[$i]); if ($res != 1) { $matched = false; break; } $pairs[$key] = $this->url_parts[$i]; $i++; } ...
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
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
public function before_content( $content ) { global $post; $post_id = $post->ID; // show on single sell media pages if ( is_singular( 'sell_media_item' ) || sell_media_attachment( $post_id ) || sell_media_is_search() ) { // bail if it's password protected item if ( post_password_required( $post ) || (...
CWE-79
1
function update_vendor() { $vendor = new vendor(); $vendor->update($this->params['vendor']); expHistory::back(); }
CWE-89
0
static function displayname() { return gt("e-Commerce Category Manager"); }
CWE-89
0
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
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
foreach ($page as $pageperm) { if (!empty($pageperm['manage'])) return true; }
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 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
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
public function executeQuery() { if ($this->query !== null) { $this->query ->offset($this->offset) ->limit($this->limit) ->orderBy($this->order, $this->direction); if ($this->formatter !== null) { return $this->form...
CWE-79
1
public function getQueryOrderby() { return $this->name; }
CWE-89
0
public function getQueryGroupby() { $R1 = 'R1_' . $this->id; $R2 = 'R2_' . $this->id; return "$R2.value"; }
CWE-89
0
$body = str_replace(array("\n"), "<br />", $body); } else { // It's going elsewhere (doesn't like quoted-printable) $body = str_replace(array("\n"), " -- ", $body); } $title = $items[...
CWE-89
0
private function SendHello($hello, $host) { fputs($this->smtp_conn, $hello . " " . $host . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { $this->edebug("SMTP -> FROM SERVER: " . $rply . $this->CRLF . '<br />'); } if($code != 250) { ...
CWE-79
1
public function withQuery($query) { if (!is_string($query) && !method_exists($query, '__toString')) { throw new \InvalidArgumentException( 'Query string must be a string' ); } $query = (string) $query; if (substr($query, 0, 1) === '?') { ...
CWE-89
0
$filename = isset($_REQUEST[$request]) ? trim($_REQUEST[$request]) : false; if (!$filename || empty($filename)) { continue; } if ($filename == wCMS::get('config', 'theme')) { wCMS::alert('danger', 'Cannot delete currently active theme.'); wCMS::redirect(); continue; ...
CWE-22
2
public static function initializeNavigation() { $sections = section::levelTemplate(0, 0); return $sections; }
CWE-89
0
. htmlspecialchars($table['table']) . '`</a>'; $html .= '</li>'; } } } else { $html .= '<li class="warp_link">' . ($this->_tableType == 'recent' ?__('There are no recent tables.') ...
CWE-79
1
public function confirm() { $project = $this->getProject(); $filter = $this->customFilterModel->getById($this->request->getIntegerParam('filter_id')); $this->response->html($this->helper->layout->project('custom_filter/remove', array( 'project' => $project, 'filt...
CWE-639
9
protected function _add_comment_log( $id, $action, $comment = null ) { if ( is_null( $comment ) ) $comment = get_comment( $id ); aal_insert_log( array( 'action' => $action, 'object_type' => 'Comments', 'object_subtype' => get_post_type( $comment->comment_post_ID ), 'object_name' => ...
CWE-79
1
public function getDisplayName ($plural=true) { return Yii::t('marketing', 'Web Form'); }
CWE-79
1
public function specialLogin( $error = null ) { $request = $this->getRequest(); $out = $this->getOutput(); $out->setPageTitle( wfMessage('soa2-login-title')->escaped() ); if ($error) { $this->error($error); } else if ( $request->wasPosted() && $request->getCheck( 'username' ) ) { $username = $requ...
CWE-79
1
function db_seq_nextval($seqname) { global $DatabaseType; if ($DatabaseType == 'mysqli') $seq = "fn_" . strtolower($seqname) . "()"; return $seq; }
CWE-79
1
function __construct(Frame $frame, Dompdf $dompdf) { parent::__construct($frame, $dompdf); $url = $frame->get_node()->getAttribute("src"); $debug_png = $dompdf->getOptions()->getDebugPng(); if ($debug_png) { print '[__construct ' . $url . ']'; } list...
CWE-73
23
function selectArraysBySql($sql) { $res = @mysqli_query($this->connection, $this->injectProof($sql)); if ($res == null) return array(); $arrays = array(); for ($i = 0, $iMax = mysqli_num_rows($res); $i < $iMax; $i++) $arrays[] = mysqli_fetch_assoc($res...
CWE-89
0
protected function emailExistsInDB($email) { /* Build sql query*/ $sql = 'SELECT * FROM '.$this->usersTable; $sql .= ' WHERE email = "'.$email.'";'; /* Execute query */ $results = $this->wiki->loadAll($sql); return $results; // If the password does not already ex...
CWE-89
0
} elseif (strtolower($icon) == 'desc') { $icon = 'fa fa-sort-desc'; } else { $icon = 'fa fa-unsorted'; } if (($db_column == '') || (substr_count($db_column, 'nosort'))) { print '<th ' . ($tip != '' ? "title='" . htmlspecialchars($tip, ENT_QUOTES, 'UTF-8') . "'":'') . " class='$nohide $align' " . ((($i...
CWE-79
1
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
protected function _copy($source, $targetDir, $name) { $this->clearcache(); $id = $this->_joinPath($targetDir, $name); $sql = $id > 0 ? sprintf('REPLACE INTO %s (id, parent_id, name, content, size, mtime, mime, width, height, `read`, `write`, `locked`, `hidden`) (SELECT %d, %d, name, content, size, mtime, mi...
CWE-89
0
$modelName = ucfirst ($module->name); if (class_exists ($modelName)) { // prefix widget class name with custom module model name and a delimiter $cache[$widgetType][$modelName.'::TemplatesGridViewProfileWidget'] = ...
CWE-79
1
$confirm = pack('H*', gps('confirm')); $name = substr($confirm, 5); $nonce = safe_field("nonce", 'txp_users', "name = '".doSlash($name)."'"); if ($nonce and $confirm === pack('H*', substr(md5($nonce), 0, 10)).$name) { include_once txpath.'/lib/txplib_admin.php'; ...
CWE-521
4
public function testSetActivePhp54() { $this->proxy->setActive(true); }
CWE-89
0
$mime = mime_content_type($path); } elseif ($type === 'getimagesize') { if ($img = @getimagesize($path)) { $mime = $img['mime']; } } if ($mime) { $mime = explode(';', $mime); $mime = trim($mime[0]); if (in_array($mime, array('application/x-empty', 'inode/x-empty'))) { // finfo ret...
CWE-89
0
public function delete() { global $user; $count = $this->address->find('count', 'user_id=' . $user->id); if($count > 1) { $address = new address($this->params['id']); if ($user->isAdmin() || ($user->id == $address->user_id)) { if ($address->is_bill...
CWE-89
0
public static function parseAndTrimExport($str, $isHTML = false) { //�Death from above�? � //echo "1<br>"; eDebug($str); $str = str_replace("�", "&rsquo;", $str); $str = str_replace("�", "&lsquo;", $str); $str = str_replace("�", "&#174;", $str); $str = str_replace("�", "-",...
CWE-89
0
self::removeLevel($kid->id); } }
CWE-89
0
public function getAlnum($key, $default = '', $deep = false) { return preg_replace('/[^[:alnum:]]/', '', $this->get($key, $default, $deep)); }
CWE-89
0
public function getDisplayName ($plural=true) { $moduleName = X2Model::getModuleName (get_class ($this)); return Modules::displayName ($plural, $moduleName); }
CWE-79
1
foreach ($page as $pageperm) { if (!empty($pageperm['manage'])) return true; }
CWE-89
0
foreach ($allusers as $uid) { $u = user::getUserById($uid); expPermissions::grant($u, 'manage', $sloc); }
CWE-89
0
public function testAggregatesHeaders() { $r = new Request('GET', 'http://foo.com', [ 'ZOO' => 'zoobar', 'zoo' => ['foobar', 'zoobar'] ]); $this->assertEquals('zoobar, foobar, zoobar', $r->getHeaderLine('zoo')); }
CWE-89
0
$_fn[] = self::buildCondition($v, ' && '); } $fn[] = '('.\implode(' || ', $_fn).')'; break; case '$where': if (\is_callable($value)) { // need implementation ...
CWE-89
0
$newret = recyclebin::restoreFromRecycleBin($iLoc, $page_id); if (!empty($newret)) $ret .= $newret . '<br>'; if ($iLoc->mod == 'container') { $ret .= scan_container($container->internal, $page_id); } } retu...
CWE-89
0
$_result[$_key] = preg_replace("/<>'\"\[\]{}:;/", "", $_value); } $result = $_result; } else { $_result = strip_tags($arr[$key]); $result = preg_replace("/<>'\"\[\]{}:;/", "", $_result); } } else { $result = $def; } r...
CWE-89
0
public function testValidateRequestUri() { new Request('GET', true); }
CWE-89
0
function db_seq_nextval($seqname) { global $DatabaseType; if ($DatabaseType == 'mysqli') $seq = "fn_" . strtolower($seqname) . "()"; return $seq; }
CWE-79
1
protected function init() { if (!($this->options['host'] || $this->options['socket']) || !$this->options['user'] || !$this->options['pass'] || !$this->options['db'] || !$this->options['path'] || !$this->options['files_table']) { return false; } $this->db = new mysqli($this->options['...
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 static function _date2timestamp( $datetime, $wtz=null ) { if( !isset( $datetime['hour'] )) $datetime['hour'] = 0; if( !isset( $datetime['min'] )) $datetime['min'] = 0; if( !isset( $datetime['sec'] )) $datetime['sec'] = 0; if( empty( $wtz ) && ( !isset( $datetime['tz'] ) || emp...
CWE-89
0
function can_process($new) { if (strlen($_POST['user_id']) < 4) { display_error( _('The user login entered must be at least 4 characters long.')); set_focus('user_id'); return false; } if (!$new && ($_POST['password'] != '')) { if (strlen($_POST['password']) < 4) { display_error( _('The password entered ...
CWE-521
4
$p = $vars['paging']-(ceil($maxpage/2)-1); $limit = $curr+ceil($maxpage/2)-1; // echo "more maxpage"; }else{ $p = $vars['paging']-(ceil($maxpage/2)-1); $limit = $curr + floor($maxpage/2); ...
CWE-89
0
public function search() { // global $db, $user; global $db; $sql = "select DISTINCT(a.id) as id, a.firstname as firstname, a.middlename as middlename, a.lastname as lastname, a.organization as organization, a.email as email "; $sql .= "from " . $db->prefix . "addresses as a "; //R J...
CWE-89
0
protected function getFile() { $task_id = $this->request->getIntegerParam('task_id'); $file_id = $this->request->getIntegerParam('file_id'); $model = 'projectFileModel'; if ($task_id > 0) { $model = 'taskFileModel'; $project_id = $this->taskFinderModel->g...
CWE-639
9
$clientIps = array_map('trim', explode(',', $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_IP])));
CWE-89
0
public function activate_address() { global $db, $user; $object = new stdClass(); $object->id = $this->params['id']; $db->setUniqueFlag($object, 'addresses', $this->params['is_what'], "user_id=" . $user->id); flash("message", gt("Successfully updated address.")); ...
CWE-89
0
$iloc = expUnserialize($container->internal); if ($db->selectObject('sectionref',"module='".$iloc->mod."' AND source='".$iloc->src."'") == null) { // There is no sectionref for this container. Populate sectionref if ($container->external != "N;") { $newSecRef = new stdClass...
CWE-89
0
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
$link_text = wp_get_attachment_image( $_post->ID, $size, $icon, $attr ); } else { $link_text = ''; } if ( trim( $link_text ) == '' ) $link_text = $_post->post_title; /** * Filters a retrieved attachment page link. * * @since 2.7.0 * * @param string $link_html The page link HTML output. * @...
CWE-79
1
private function getTempDir($volumeTempPath = null) { $testDirs = array(); if ($this->uploadTempPath) { $testDirs[] = rtrim(realpath($this->uploadTempPath), DIRECTORY_SEPARATOR); } if ($volumeTempPath) { $testDirs[] = rtrim(realpath($volumeTempPath), DIRECTORY_SEPARATOR); } if (function_exists('sys_g...
CWE-89
0
private function getSwimlane() { $swimlane = $this->swimlaneModel->getById($this->request->getIntegerParam('swimlane_id')); if (empty($swimlane)) { throw new PageNotFoundException(); } return $swimlane; }
CWE-639
9
function searchName() { return gt('Webpage'); }
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 __construct () { }
CWE-89
0
public function testPhpSession53() { if (PHP_VERSION_ID >= 50400) { $this->markTestSkipped('Test skipped, for PHP 5.3 only.'); } $storage = $this->getStorage(); $this->assertFalse(isset($_SESSION)); $this->assertFalse($storage->getSaveHandler()->isActive());...
CWE-89
0
}elseif($p->status == 1){ $status = "<a href=\"index.php?page=users&act=inactive&id={$p->id}&token=".TOKEN."\" class=\"label label-primary\">Active</a>"; }
CWE-89
0
public function validate() { global $db; // check for an sef url field. If it exists make sure it's valid and not a duplicate //this needs to check for SEF URLS being turned on also: TODO if (property_exists($this, 'sef_url') && !(in_array('sef_url', $this->do_not_validate))) { ...
CWE-89
0
unset($m[0][$i], $m[1][$i], $m[2][$i], $m[3][$i], $k, $v, $i); } } return $r; }
CWE-502
15
$cont_title = substr(Typo::Xclean(Typo::strip($data['posts'][0]->title)),0,$limit); $titlelength = strlen($data['posts'][0]->title); }else{
CWE-89
0
public function update(Request $request, string $attachmentId) { $attachment = $this->attachment->newQuery()->findOrFail($attachmentId); try { $this->validate($request, [ 'attachment_edit_name' => 'required|string|min:1|max:255', 'attachment_edit_url'...
CWE-79
1
public function showall_tags() { $images = $this->image->find('all'); $used_tags = array(); foreach ($images as $image) { foreach($image->expTag as $tag) { if (isset($used_tags[$tag->id])) { $used_tags[$tag->id]->count++; } else...
CWE-89
0
public static function filesByMedia($media, $offset=0, $limit=-1, $wid=NULL, $text="", $orderby="date_added DESC, name ASC") { global $DB; global $website; if(empty($wid)) $wid = $website->id; if($limit < 1) $limit = 2147483647; if(!empty($text)) $text = ' AND name...
CWE-89
0
unlink($file); } foreach (self::$tempImages as $versions) { foreach ($versions as $file) { if ($file === self::$broken_image) { continue; } if ($debugPng) { print "[unlink temp image $file]";...
CWE-73
23
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 dropdown($vars) { if(is_array($vars)){ //print_r($vars); $name = $vars['name']; $where = "WHERE "; if(isset($vars['parent'])) { $where .= " `parent` = '{$vars['parent']}' "; }else{ $where .= "1...
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
$input = (function ($settingName, $setting, $appView) { $settingId = str_replace('.', '_', $settingName); return $this->Bootstrap->switch([ 'label' => h($setting['description']), 'checked' => !empty($setting['value']), 'id' => $settingId, ...
CWE-79
1
public static function page($vars) { switch (SMART_URL) { case true: $inFold = (Options::v('permalink_use_index_php') == "on")? "/index.php/":"/"; if (Options::v('multilang_enable') === 'on') { $lang = Language::isActive(); ...
CWE-89
0
function process_user(){ #'''Call /delta for the given user ID and process any changes.''' // creation d'un client dropbox include("lib/dropboxAPI.php"); $myCustomClient = new dbx\Client($accessToken, $clientIdentifier); //Articles $pathPrefix="/Chargements appareil photo/ArticleTdm"; $cursortx...
CWE-79
1
public static function post($vars) { switch (SMART_URL) { case true: # code... $url = Options::get('siteurl')."/".self::slug($vars)."/{$vars}"; break; default: # code... $url = Options::get('...
CWE-89
0
function ngettext($single, $plural, $number) { if ($this->short_circuit) { if ($number != 1) return $plural; else return $single; } // find out the appropriate form $select = $this->select_string($number); // this should contains all strings separated by NULLs $ke...
CWE-94
14