code stringlengths 12 2.05k | label_name stringlengths 6 8 | label int64 0 95 |
|---|---|---|
$f = function (\Symfony\Component\DependencyInjection\Tests\Fixtures\TestServiceSubscriber $v) { return $v; }; return $f(${($_ = isset($this->services['Symfony\Component\DependencyInjection\Tests\Fixtures\TestServiceSubscriber']) ? $this->services['Symfony\Component\DependencyInjection\Tests\Fixtures\TestSe... | 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 testQueryMustBeValid()
{
(new Uri(''))->withQuery(new \stdClass);
} | CWE-89 | 0 |
public function testPages () {
$this->visitPages ( $this->allPages );
} | CWE-79 | 1 |
public function take($value)
{
return $this->limit($value);
} | CWE-79 | 1 |
public function setLinks($links)
{
$return = $this->setOneToMany($links, Link::class, 'links', 'container');
$this->setType('ctLinks');
return $return;
} | CWE-79 | 1 |
$this->_writeBackup($tmpDir . 'plugin' . DS, $plugin['Plugin']['name'], $encoding);
}
}
// ZIP圧縮して出力
$fileName = 'baserbackup_' . $version . '_' . date('Ymd_His');
$Simplezip = new Simplezip();
$Simplezip->addFolder($tmpDir);
$Simplezip->download($fileName);
$this->_resetTmpSchemaFolder();
exit()... | CWE-78 | 6 |
self::rpc($p);
//echo "'$p'<br>";
}
}
}
| CWE-89 | 0 |
foreach($fields as $field)
{
if(substr($key, 0, strlen($field.'-'))==$field.'-')
$this->dictionary[substr($key, strlen($field.'-'))][$field] = $value;
}
| CWE-79 | 1 |
protected function _copy($source, $targetDir, $name)
{
$res = false;
$target = $this->_joinPath($targetDir, $name);
if ($this->tmp) {
$local = $this->getTempFile();
if ($this->connect->get($source, $local)
&& $this->connect->put($target, $local, ... | CWE-22 | 2 |
public function actionGetItems(){
$sql =
'SELECT id, name as value
FROM x2_templates
WHERE name
LIKE :qterm
ORDER BY name ASC';
$command = Yii::app()->db->createCommand($sql);
$qterm = $_GET['term'].'%';
$command->bind... | 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 |
public function manage_versions() {
expHistory::set('manageable', $this->params);
$hv = new help_version();
$current_version = $hv->find('first', 'is_current=1');
$sql = 'SELECT hv.*, COUNT(h.title) AS num_docs FROM '.DB_TABLE_PREFIX.'_help h ';
$sql .= 'RIGHT JOIN '.DB_TABLE_PREF... | CWE-89 | 0 |
$loc = expCore::makeLocation('navigation', '', $standalone->id);
if (expPermissions::check('manage', $loc)) return true;
}
return false;
}
| CWE-89 | 0 |
public function withPort($port)
{
$port = $this->filterPort($this->scheme, $this->host, $port);
if ($this->port === $port) {
return $this;
}
$new = clone $this;
$new->port = $port;
return $new;
} | CWE-89 | 0 |
public function __invoke(Request $request)
{
$this->authorize('manage modules');
$response = ModuleInstaller::upload($request);
return response()->json($response);
} | CWE-502 | 15 |
public function lists($column, $key = null)
{
$select = is_null($key) ? [$column] : [$column, $key];
if (!is_null($this->cacheMinutes)) {
$results = $this->getCached($select);
}
else {
$results = $this->getFresh($select);
}
$collection = ... | 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 |
function ac_sigleme($str, $name, $id) {
global $cms_db, $sess;
$sess->gc( true );
if( $id >= 1 && $this->session_enabled ) {
$this->db->query(sprintf("delete from %s where name = '%s' and sid != '%s' and user_id = '%s'",
$cms_db[sessions],
addslashes... | CWE-89 | 0 |
function remove() {
global $db;
$section = $db->selectObject('section', 'id=' . $this->params['id']);
if ($section) {
section::removeLevel($section->id);
$db->decrement('section', 'rank', 1, 'rank > ' . $section->rank . ' AND parent=' . $section->parent);
... | CWE-89 | 0 |
private function sendString ($string) {
$bytes_sent = fwrite($this->pop_conn, $string, strlen($string));
return $bytes_sent;
} | CWE-79 | 1 |
public function enable()
{
$this->checkCSRFParam();
$project = $this->getProject();
$swimlane_id = $this->request->getIntegerParam('swimlane_id');
if ($this->swimlaneModel->enable($project['id'], $swimlane_id)) {
$this->flash->success(t('Swimlane updated successfully... | CWE-639 | 9 |
public function update_version() {
// get the current version
$hv = new help_version();
$current_version = $hv->find('first', 'is_current=1');
// check to see if the we have a new current version and unset the old current version.
if (!empty($this->params['is_current'])) {
// $db... | CWE-89 | 0 |
public static function insert($vars) {
if(is_array($vars)) {
$slug = Typo::slugify($vars['title']);
$vars = array_merge($vars, array('slug' => $slug));
//print_r($vars);
$ins = array(
'table' => 'options',
'key' ... | CWE-79 | 1 |
public function setContainer($container)
{
$this->container = $container;
$container->setType('ctLinks');
} | CWE-79 | 1 |
function db_seq_nextval($seqname)
{
global $DatabaseType;
if ($DatabaseType == 'mysqli')
$seq = "fn_" . strtolower($seqname) . "()";
return $seq;
} | CWE-22 | 2 |
public static function ModMenu(){
$json = Options::v('modules');
$mod = json_decode($json, true);
//$mod = self::modList();
//print_r($mod);
if(is_array($mod)){
$list = '';
asort($mod);
foreach ($mod as $m) {
# code... | CWE-89 | 0 |
function manage() {
expHistory::set('viewable', $this->params);
// $category = new storeCategory();
// $categories = $category->getFullTree();
//
// // foreach($categories as $i=>$val){
// // if (!empty($this->values) && in_ar... | CWE-89 | 0 |
} elseif (!empty($this->params['src'])) {
if ($this->params['src'] == $loc->src) {
$this->config = $config->config;
break;
}
}
}
| CWE-89 | 0 |
public static function content($vars) {
$post = Typo::Xclean($vars);
preg_match_all("[[\-\-readmore\-\-]]", $post, $more);
if (is_array($more[0])) {
$post = str_replace('[[--readmore--]]', '', $post);
// return $post;
}else{
$post = $pos... | CWE-89 | 0 |
return new Response($emailLog->getHtmlLog());
} elseif ($request->get('type') == 'params') { | CWE-79 | 1 |
public function enable()
{
$this->checkCSRFParam();
$project = $this->getProject();
$swimlane_id = $this->request->getIntegerParam('swimlane_id');
if ($this->swimlaneModel->enable($project['id'], $swimlane_id)) {
$this->flash->success(t('Swimlane updated successfully... | CWE-639 | 9 |
function selectBillingOptions() {
} | CWE-89 | 0 |
foreach ($allgroups as $gid) {
$g = group::getGroupById($gid);
expPermissions::grantGroup($g, 'manage', $sloc);
}
| CWE-89 | 0 |
protected function _mkdir($path, $name) {
$path = $this->_joinPath($path, $name);
if (@mkdir($path)) {
@chmod($path, $this->options['dirMode']);
clearstatcache();
return $path;
}
return false;
} | CWE-89 | 0 |
static function author() {
return "Dave Leffler";
}
| CWE-89 | 0 |
$files[$key]->save();
}
// eDebug($files,true);
} | CWE-89 | 0 |
public function getLatestRevisions()
{
if (! $this->latest_revisions) {
$pm = ProjectManager::instance();
$project = $pm->getProject($this->group_id);
if ($project && $this->canBeUsedByProject($project)) {
list($this->latest_revisions,) = svn_get_revis... | CWE-89 | 0 |
public static function create(
RequestInterface $request,
ResponseInterface $response = null,
\Exception $previous = null,
array $ctx = []
) {
if (!$response) {
return new self(
'Error completing request',
$request,
... | CWE-89 | 0 |
firstname: l.attr('data-firstname')
});
l.append(`
<div class="member-details">
${member_item}
${l.attr('data-name') || `${member_itemtype} (${member_items_id})`}
</d... | CWE-79 | 1 |
$banner->increaseImpressions();
}
}
// assign banner to the template and show it!
assign_to_template(array(
'banners'=>$banners
));
} | CWE-89 | 0 |
public function scopeSearch(Builder $query, array $search = [])
{
if (empty($search)) {
return $query;
}
if (!array_intersect(array_keys($search), $this->searchable)) {
return $query;
}
return $query->where($search);
} | CWE-89 | 0 |
public function backup($type='json')
{
global $DB;
global $website;
$out = array();
$DB->query('
SELECT * FROM nv_paths
WHERE website = '.protect($website->id),
'object'
);
$out = $DB->result();
if($type='json')
... | CWE-89 | 0 |
public function render($ignoreCli = false)
{
if (!$ignoreCli && php_sapi_name() == 'cli') {
$this->log();
file_put_contents('php://stderr', $this->getException()->__toString()."\n");
exit(1);
}
$view = Kwf_Debug::getView();
$view->exception = ... | CWE-79 | 1 |
list($workgroup, $user) = explode('\\', $user);
} else {
$workgroup = null;
}
$this->state->init($workgroup, $user, $this->server->getPassword());
} | CWE-78 | 6 |
public function enable()
{
$this->checkCSRFParam();
$project = $this->getProject();
$swimlane_id = $this->request->getIntegerParam('swimlane_id');
if ($this->swimlaneModel->enable($project['id'], $swimlane_id)) {
$this->flash->success(t('Swimlane updated successfully... | CWE-639 | 9 |
$product = X2Model::model('Products')->findByAttributes(array('name'=>$lineItem->name));
if (isset($product))
$lineItem->productId = $product->id;
if(empty($lineItem->currency))
$lineItem->currency = $defaultCurrency;
if($lin... | CWE-79 | 1 |
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 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 show()
{
$task = $this->getTask();
$subtask = $this->getSubtask();
$this->response->html($this->template->render('subtask_converter/show', array(
'subtask' => $subtask,
'task' => $task,
)));
} | CWE-639 | 9 |
static function FromJSON($sJson)
{
if (is_array($sJson))
{
$aJson = $sJson;
}
else
{
$aJson = json_decode($sJson, true);
}
/** @var \Combodo\iTop\Portal\Form\ObjectFormManager $oFormManager */
$oFormManager = parent::FromJSON($sJson);
// Retrieving object to edit
if (!isset($aJson['formobj... | CWE-94 | 14 |
form_selectable_cell(filter_value($vdef['name'], get_request_var('filter'), 'vdef.php?action=edit&id=' . $vdef['id']), $vdef['id']);
form_selectable_cell($disabled ? __('No'):__('Yes'), $vdef['id'], '', 'text-align:right');
form_selectable_cell(number_format_i18n($vdef['graphs'], '-1'), $vdef... | CWE-79 | 1 |
public function editAlt() {
global $user;
$file = new expFile($this->params['id']);
if ($user->id==$file->poster || $user->isAdmin()) {
$file->alt = $this->params['newValue'];
$file->save();
$ar = new expAjaxReply(200, gt('Your alt was updated succ... | CWE-89 | 0 |
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 val ($vars) {
$val = $_SESSION['gxsess']['val'];
foreach ($val as $k => $v) {
# code...
switch ($k) {
case $vars:
return $v;
break;
default:
... | 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 |
function unlockTables() {
$sql = "UNLOCK TABLES";
$res = mysqli_query($this->connection, $sql);
return $res;
} | CWE-89 | 0 |
static protected function getFontsizeSelection()
{
$current_size = $GLOBALS['PMA_Config']->get('fontsize');
// for the case when there is no config file (this is supported)
if (empty($current_size)) {
if (isset($_COOKIE['pma_fontsize'])) {
$current_size = $_CO... | CWE-79 | 1 |
public function getPrintAndMailLink($icmsObj) {
global $icmsConfig, $impresscms;
$ret = '';
/* $printlink = $this->handler->_moduleUrl . "print.php?" . $this->handler->keyName . "=" . $icmsObj->getVar($this->handler->keyName);
$js = "javascript:openWithSelfMain('" . $printlink . "', 'smartpopup', 700, ... | CWE-22 | 2 |
function configure() {
expHistory::set('editable', $this->params);
// little bit of trickery so that that categories can have their own configs
$this->loc->src = "@globalstoresettings";
$config = new expConfig($this->loc);
$this->config = $config->config;
$pu... | 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 |
public function umount() {
$this->connect && @ftp_close($this->connect);
} | CWE-89 | 0 |
public static function Xclean($vars) {
$var = htmlspecialchars_decode($vars);
// $var = html_entity_decode($vars);
return $var;
} | CWE-89 | 0 |
function get_the_generator( $type = '' ) {
if ( empty( $type ) ) {
$current_filter = current_filter();
if ( empty( $current_filter ) ) {
return;
}
switch ( $current_filter ) {
case 'rss2_head':
case 'commentsrss2_head':
$type = 'rss2';
break;
case 'rss_head':
case 'opml_head':
$typ... | CWE-79 | 1 |
public function get($extramediatypes = false) {
try {
return $this->getConfig($extramediatypes);
} catch (\Exception $exception) {
return $this->jsonError($exception);
}
} | CWE-79 | 1 |
public function beforeSave () {
$valid = parent::beforeSave ();
if ($valid) {
$table = Yii::app()->db->schema->tables[$this->myTableName];
$existing = array_key_exists($this->fieldName, $table->columns) &&
$table->columns[$this->fieldName] instanceof CDbColum... | CWE-79 | 1 |
public static function CanTrustFormLayoutContent($sPostedFormManagerData, $aOriginalFormProperties)
{
$aPostedFormManagerData = json_decode($sPostedFormManagerData, true);
$sPostedFormLayoutType = (isset($aPostedFormManagerData['formproperties']['layout']['type'])) ? $aPostedFormManagerData['formproperties']['lay... | CWE-94 | 14 |
public function createDatabase($dbname = null)
{
Database::query("CREATE DATABASE `" . $dbname . "`");
} | 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 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 getFileContent($file, $identifier)
{
$resource = sprintf('hg cat -r %s %s', ProcessExecutor::escape($identifier), ProcessExecutor::escape($file));
$this->process->execute($resource, $content, $this->repoDir);
if (!trim($content)) {
return null;
}
... | CWE-94 | 14 |
public function delete($id)
{
if ($this->securityController->isWikiHibernated()) {
throw new \Exception(_t('WIKI_IN_HIBERNATION'));
}
// tests of if $formId is int
if (strval(intval($id)) != strval($id)) {
return null ;
}
$this->clear($id... | CWE-89 | 0 |
public function Disconnect () {
$this->sendString('QUIT');
fclose($this->pop_conn);
} | CWE-79 | 1 |
public static function incFunc($var) {
if (self::functionExist($var)) {
include(GX_THEME.$var.'/function.php');
}
}
| CWE-89 | 0 |
public function withScheme($scheme)
{
$scheme = $this->filterScheme($scheme);
if ($this->scheme === $scheme) {
return $this;
}
$new = clone $this;
$new->scheme = $scheme;
$new->port = $new->filterPort($new->scheme, $new->host, $new->port);
re... | CWE-89 | 0 |
foreach ($criteria as $criterion) {
// recursive call
if (isset($criterion['criteria'])) {
return $check_criteria($criterion['criteria']);
}
if (!isset($criterion['field']) || !isset($criterion['searchtype'])
|... | CWE-89 | 0 |
$user = db_fetch_cell_prepared('SELECT username FROM user_auth WHERE id = ?', array($check['user']), 'username');
form_alternate_row('line' . $check['id']);
$name = get_data_source_title($check['datasource']);
$title = $name;
if (strlen($name) > 50) {
$name = substr($name, 0, 50);
}
form_select... | CWE-79 | 1 |
$section = new section(intval($page));
if ($section) {
// self::deleteLevel($section->id);
$section->delete();
}
}
}
| CWE-89 | 0 |
public function update()
{
global $DB;
global $events;
if(!is_array($this->categories))
$this->categories = array();
$ok = $DB->execute('
UPDATE nv_feeds
SET categories = :categories, format = :format, image = :image, entries = :entries,
content = :content, views = :views... | CWE-79 | 1 |
public function delete()
{
global $DB;
global $user;
global $events;
$ok = false;
if($user->permission("themes.delete")=="false")
throw new Exception(t(610, "Sorry, you are not allowed to execute this function."));
if(file_exists(NAVIGATE_PATH.'/plug... | CWE-89 | 0 |
public function remove()
{
$this->checkCSRFParam();
$project = $this->getProject();
$swimlane_id = $this->request->getIntegerParam('swimlane_id');
if ($this->swimlaneModel->remove($project['id'], $swimlane_id)) {
$this->flash->success(t('Swimlane removed successfully... | CWE-639 | 9 |
public function getTopRated(){
$url = "http://api.themoviedb.org/3/movie/top_rated?api_key=".$this->apikey;
$top_rated = $this->curl($url);
return $top_rated;
}
| CWE-89 | 0 |
$dt = date('Y-m-d', strtotime($match));
$sql = par_rep("/'$match'/", "'$dt'", $sql);
}
}
if (substr($sql, 0, 6) == "BEGIN;") {
$array = explode(";", $sql);
foreach ($array as $value) {
if ($value != "") {
$result = $connection->query($value);
if (!$result) {
$connecti... | CWE-22 | 2 |
protected function _move($source, $targetDir, $name)
{
$target = $this->_joinPath($targetDir, $name);
return $this->connect->rename($source, $target) ? $target : false;
} | CWE-22 | 2 |
function critere_where_dist($idb, &$boucles, $crit) {
$boucle = &$boucles[$idb];
if (isset($crit->param[0])) {
$_where = calculer_liste($crit->param[0], $idb, $boucles, $boucle->id_parent);
} else {
$_where = '@$Pile[0]["where"]';
}
if ($crit->cond) {
$_where = "(($_where) ? ($_where) : '')";
}
if ($crit... | CWE-79 | 1 |
public function searchAdmin(){
$criteria = new CDbCriteria;
return $this->searchBase($criteria);
} | CWE-79 | 1 |
public function save()
{
global $DB;
if(!empty($this->id))
return $this->update();
else
return $this->insert();
}
| CWE-79 | 1 |
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 |
foreach ($allgroups as $gid) {
$g = group::getGroupById($gid);
expPermissions::grantGroup($g, 'manage', $sloc);
}
| CWE-89 | 0 |
protected function optionsPage()
{
//FIXME Put Options code in here.
} | CWE-89 | 0 |
public function quicksearch($text)
{
global $DB;
global $website;
$like = ' LIKE '.protect('%'.$text.'%');
// we search for the IDs at the dictionary NOW (to avoid inefficient requests)
$DB->query('SELECT DISTINCT (nvw.node_id)
FROM nv_webdictionary nvw
WHERE nvw.node_type = ... | CWE-79 | 1 |
protected function initServiceMode($request)
{
$config = $this->Application()->Config();
if (!empty($config->setOffline) && strpos($config->offlineIp, $request->getClientIp()) === false) {
if ($request->getControllerName() !== 'error') {
$request->setControllerName('e... | CWE-601 | 11 |
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 |
public static function checkPermissions($permission,$location) {
global $exponent_permissions_r, $router;
// only applies to the 'manage' method
if (empty($location->src) && empty($location->int) && (!empty($router->params['action']) && $router->params['action'] == 'manage') || strpos($... | CWE-89 | 0 |
public static function id($userid){
$usr = Db::result(
sprintf("SELECT * FROM `user` WHERE `userid` = '%s' LIMIT 1",
Typo::cleanX($userid)
)
);
return $usr[0]->id;
}
| CWE-89 | 0 |
public function sdm_save_other_details_meta_data($post_id) { // Save Statistics Upload metabox
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
return;
}
if (!isset($_POST['sdm_other_details_nonce_check']) || !wp_verify_nonce($_POST['sdm_other_details_nonce_check'], 'sdm_other_details_nonce')) {
ret... | CWE-79 | 1 |
foreach ($cf_d as $cfd_i => $cfd_d) {
if ($cfd_i == 'TYPE') {
$fc = substr($cfd_d, 0, 1);
$lc = substr($cfd_d, 1);
$cfd_d = strtoupper($fc) . $lc;
$get_schools_cf[$cf_i][$cfd_i] = $cfd_d;
unset($fc);
unse... | CWE-22 | 2 |
public function saveNewUpload(UploadedFile $uploadedFile, $page_id)
{
$attachmentName = $uploadedFile->getClientOriginalName();
$attachmentPath = $this->putFileInStorage($uploadedFile);
$largestExistingOrder = Attachment::where('uploaded_to', '=', $page_id)->max('order');
$attac... | CWE-22 | 2 |
public function confirm()
{
$project = $this->getProject();
$category = $this->getCategory();
$this->response->html($this->helper->layout->project('category/remove', array(
'project' => $project,
'category' => $category,
)));
} | CWE-639 | 9 |
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-79 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.