code
stringlengths 12
2.05k
| label_name
stringlengths 6
8
| label
int64 0
95
|
---|---|---|
public static function quoteValue($value) {
if ($value instanceof QueryParam || $value instanceof QueryExpression) {
//no quote for query parameters nor expressions
$value = $value->getValue();
} else if ($value === null || $value === 'NULL' || $value === 'null') {
$value = 'NULL';
} else if (!preg_match("/^`.*?`$/", $value)) { //`field` is valid only for mysql :/
//phone numbers may start with '+' and will be considered as numeric
$value = "'$value'";
}
return $value;
} | CWE-89 | 0 |
self::$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
return self::$mysqli;
}
} | CWE-79 | 1 |
public function load_by_profile($network, $network_user_id)
{
global $DB;
global $session;
// the profile exists (connected to a social network)?
$swuser = $DB->query_single(
'webuser',
'nv_webuser_profiles',
' network = '.protect($network).' AND '.
' network_user_id = '.protect($network_user_id)
);
if(!empty($swuser))
$this->load($swuser);
}
| CWE-89 | 0 |
public function execute()
{
// call parent, this will probably add some general CSS/JS or other required files
parent::execute();
// get parameters
$term = SpoonFilter::getPostValue('term', null, '');
$limit = (int) FrontendModel::getModuleSetting('search', 'autocomplete_num_items', 10);
// validate
if($term == '') $this->output(self::BAD_REQUEST, null, 'term-parameter is missing.');
// get matches
$matches = FrontendSearchModel::getStartsWith($term, FRONTEND_LANGUAGE, $limit);
// get search url
$url = FrontendNavigation::getURLForBlock('search');
// loop items and set search url
foreach($matches as &$match) $match['url'] = $url . '?form=search&q=' . $match['term'];
// output
$this->output(self::OK, $matches);
} | CWE-79 | 1 |
public function countFilesInFolder(Folder $folder, $useFilters = true, $recursive = false)
{
$this->assureFolderReadPermission($folder);
$filters = $useFilters ? $this->fileAndFolderNameFilters : [];
return $this->driver->countFilesInFolder($folder->getIdentifier(), $recursive, $filters);
} | CWE-319 | 8 |
$percent = round($percent, 0);
} else {
$percent = round($percent, 2); // school default
}
if ($ret == '%')
return $percent;
if (!$_openSIS['_makeLetterGrade']['grades'][$grade_scale_id])
$_openSIS['_makeLetterGrade']['grades'][$grade_scale_id] = DBGet(DBQuery('SELECT TITLE,ID,BREAK_OFF FROM report_card_grades WHERE SYEAR=\'' . $cp[1]['SYEAR'] . '\' AND SCHOOL_ID=\'' . $cp[1]['SCHOOL_ID'] . '\' AND GRADE_SCALE_ID=\'' . $grade_scale_id . '\' ORDER BY BREAK_OFF IS NOT NULL DESC,BREAK_OFF DESC,SORT_ORDER'));
foreach ($_openSIS['_makeLetterGrade']['grades'][$grade_scale_id] as $grade) {
if ($does_breakoff == 'Y' ? $percent >= $programconfig[$staff_id][$course_period_id . '-' . $grade['ID']] && is_numeric($programconfig[$staff_id][$course_period_id . '-' . $grade['ID']]) : $percent >= $grade['BREAK_OFF'])
return $ret == 'ID' ? $grade['ID'] : $grade['TITLE'];
}
} | CWE-22 | 2 |
public function load_by_code($code)
{
global $DB;
global $website;
if($DB->query('SELECT * FROM nv_block_groups
WHERE code = '.protect($code).'
AND website = '.$website->id))
{
$data = $DB->result();
$this->load_from_resultset($data);
}
}
| CWE-89 | 0 |
public function show()
{
$task = $this->getTask();
$subtask = $this->getSubtask();
$this->response->html($this->template->render('subtask_restriction/show', array(
'status_list' => array(
SubtaskModel::STATUS_TODO => t('Todo'),
SubtaskModel::STATUS_DONE => t('Done'),
),
'subtask_inprogress' => $this->subtaskStatusModel->getSubtaskInProgress($this->userSession->getId()),
'subtask' => $subtask,
'task' => $task,
)));
} | CWE-639 | 9 |
function download($disposition=false, $expires=false) {
$disposition = $disposition ?: 'inline';
$bk = $this->open();
if ($bk->sendRedirectUrl($disposition))
return;
$ttl = ($expires) ? $expires - Misc::gmtime() : false;
$this->makeCacheable($ttl);
$type = $this->getType() ?: 'application/octet-stream';
Http::download($this->getName(), $type, null, 'inline');
header('Content-Length: '.$this->getSize());
$this->sendData(false);
exit();
} | CWE-434 | 5 |
function escape_command($command) {
return preg_replace("/(\\\$|`)/", "", $command);
} | CWE-94 | 14 |
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
if (empty($section->id)) {
$section->public = 1;
if (!isset($section->parent)) {
// This is another precaution. The parent attribute
// should ALWAYS be set by the caller.
//FJD - if that's the case, then we should die.
notfoundController::handle_not_authorized();
exit;
//$section->parent = 0;
}
}
assign_to_template(array(
'section' => $section,
'glyphs' => self::get_glyphs(),
));
}
| CWE-89 | 0 |
public static function withQueryValue(UriInterface $uri, $key, $value)
{
$current = $uri->getQuery();
$key = strtr($key, self::$replaceQuery);
if (!$current) {
$result = [];
} else {
$result = [];
foreach (explode('&', $current) as $part) {
if (explode('=', $part)[0] !== $key) {
$result[] = $part;
};
}
}
if ($value !== null) {
$result[] = $key . '=' . strtr($value, self::$replaceQuery);
} else {
$result[] = $key;
}
return $uri->withQuery(implode('&', $result));
} | CWE-89 | 0 |
$sql = array(
'table' => 'menus',
'id' => Typo::int($k),
'key' => $v
);
Db::update($sql);
}
| CWE-89 | 0 |
public function testFullRun()
{
$command = $this->getCommand();
$commandTester = new CommandTester($command);
$commandTester->setInputs(['no']);
$commandTester->execute([
'command' => $command->getName(),
]);
$result = $commandTester->getDisplay();
self::assertStringContainsString('Kimai updates running', $result);
// make sure migrations run always
self::assertStringContainsString('Application Migrations', $result);
self::assertStringContainsString('No migrations to execute.', $result);
self::assertStringContainsString(
sprintf('[OK] Congratulations! Successfully updated Kimai to version %s (%s)', Constants::VERSION, Constants::STATUS),
$result
);
self::assertEquals(0, $commandTester->getStatusCode());
} | CWE-1236 | 12 |
protected function deleteFileInStorage(Attachment $attachment)
{
$storage = $this->getStorage();
$dirPath = $this->adjustPathForStorageDisk(dirname($attachment->path));
$storage->delete($this->adjustPathForStorageDisk($attachment->path));
if (count($storage->allFiles($dirPath)) === 0) {
$storage->deleteDirectory($dirPath);
}
} | CWE-22 | 2 |
function DateInputAY($value, $name, $counter = 1, $placeholder = _enterDate)
{
$show = "";
$date_sep = "";
$monthVal = "";
$yearVal = "";
$dayVal = "";
$display = "";
if ($value != '')
return '<table><tr><td><div id="date_div_' . $counter . '" style="display: inline" >' . ProperDateAY($value) . ' </div></td><td><input type=text id="date_' . $counter . '" ' . $show . ' style="display:none" readonly></td><td><a onClick="init(' . $counter . ',2);"><img src="assets/calendar.gif" /></a></td><td><input type=hidden ' . $monthVal . ' id="monthSelect' . $counter . '" name="month_' . $name . '" ><input type=hidden ' . $dayVal . ' id="daySelect' . $counter . '" name="day_' . $name . '"><input type=hidden ' . $yearVal . ' id="yearSelect' . $counter . '" name="year_' . $name . '" ></td></tr></table>';
else {
if ($counter == 2)
return '<input type="text" id="date_' . $counter . '" data-placeholder="' . $placeholder . '" class="form-control daterange-single"><input type=hidden ' . $monthVal . ' id="monthSelect' . $counter . '" name="month_' . $name . '" /><input type=hidden ' . $dayVal . ' id="daySelect' . $counter . '" name="day_' . $name . '" /><input type=hidden ' . $yearVal . ' id="yearSelect' . $counter . '" name="year_' . $name . '" />';
else
return '<input type="text" id="date_' . $counter . '" data-placeholder="' . $placeholder . '" class="form-control daterange-single"><input type=hidden ' . $monthVal . ' id="monthSelect' . $counter . '" name="month_' . $name . '" /><input type=hidden ' . $dayVal . ' id="daySelect' . $counter . '" name="day_' . $name . '"><input type=hidden ' . $yearVal . ' id="yearSelect' . $counter . '" name="year_' . $name . '" />';
}
} | CWE-79 | 1 |
public function behaviors() {
return array_merge(parent::behaviors(),array(
'X2LinkableBehavior'=>array(
'class'=>'X2LinkableBehavior',
'module'=>'marketing'
),
'ERememberFiltersBehavior' => array(
'class'=>'application.components.ERememberFiltersBehavior',
'defaults'=>array(),
'defaultStickOnClear'=>false
)
));
} | CWE-79 | 1 |
public static function activate($mod){
$json = Options::v('modules');
$mods = json_decode($json, true);
//print_r($mods);
if (!is_array($mods) || $mods == "") {
$mods = array();
}
if (!in_array($mod, $mods)) {
# code...
$mods = array_merge($mods, array($mod));
}
$mods = json_encode($mods);
$mods = Options::update('modules', $mods);
if($mods){
new Options();
return true;
}else{
return false;
}
}
| CWE-89 | 0 |
protected function imageExtensions()
{
return [
'jpg',
'jpeg',
'bmp',
'png',
'webp',
'gif',
'svg'
];
} | CWE-79 | 1 |
private function getHttpResponseHeader($url) {
if (function_exists('curl_exec')) {
$c = curl_init();
curl_setopt( $c, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $c, CURLOPT_CUSTOMREQUEST, 'HEAD' );
curl_setopt( $c, CURLOPT_HEADER, 1 );
curl_setopt( $c, CURLOPT_NOBODY, true );
curl_setopt( $c, CURLOPT_URL, $url );
$res = curl_exec( $c );
} else {
require_once 'HTTP/Request2.php';
try {
$request2 = new HTTP_Request2();
$request2->setConfig(array(
'ssl_verify_peer' => false,
'ssl_verify_host' => false
));
$request2->setUrl($url);
$request2->setMethod(HTTP_Request2::METHOD_HEAD);
$result = $request2->send();
$res = array();
$res[] = 'HTTP/'.$result->getVersion().' '.$result->getStatus().' '.$result->getReasonPhrase();
foreach($result->getHeader() as $key => $val) {
$res[] = $key . ': ' . $val;
}
$res = join("\r\n", $res);
} catch( HTTP_Request2_Exception $e ){
$res = '';
} catch (Exception $e){
$res = '';
}
}
return $res;
} | CWE-89 | 0 |
protected function _draft_or_post_title( $post = 0 ) {
$title = get_the_title( $post );
if ( empty( $title ) )
$title = __( '(no title)', 'aryo-activity-log' );
return $title;
} | CWE-79 | 1 |
$emails[$u->email] = trim(user::getUserAttribution($u->id));
}
| CWE-89 | 0 |
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($router->current_url, 'action=manage') !== false) {
if (!empty($exponent_permissions_r['navigation'])) foreach ($exponent_permissions_r['navigation'] as $page) {
foreach ($page as $pageperm) {
if (!empty($pageperm['manage'])) return true;
}
}
}
return false;
}
| CWE-89 | 0 |
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($this->params['filenum'])) $this->params['filenum'] = 0;
if (empty($fd->expFile['downloadable'][$this->params['filenum']]->id)) {
flash('error', gt('There was an error while trying to download your file. The file you were looking for could not be found.'));
expHistory::back();
}
$fd->downloads++;
$fd->save();
// this will set the id to the id of the actual file..makes the download go right.
$this->params['id'] = $fd->expFile['downloadable'][$this->params['filenum']]->id;
parent::downloadfile();
} | CWE-89 | 0 |
public function configure() {
$this->config['defaultbanner'] = array();
if (!empty($this->config['defaultbanner_id'])) {
$this->config['defaultbanner'][] = new expFile($this->config['defaultbanner_id']);
}
parent::configure();
$banners = $this->banner->find('all', null, 'companies_id');
assign_to_template(array(
'banners'=>$banners,
'title'=>static::displayname()
));
} | 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;
$event_cache->body = $extevent->body;
$event_cache->eventdate = $extevent->eventdate->date;
if (isset($extevent->dateFinished) && $extevent->dateFinished != -68400)
$event_cache->dateFinished = $extevent->dateFinished;
if (isset($extevent->eventstart))
$event_cache->eventstart = $extevent->eventstart;
if (isset($extevent->eventend))
$event_cache->eventend = $extevent->eventend;
if (isset($extevent->is_allday))
$event_cache->is_allday = $extevent->is_allday;
$found = false;
if ($extevent->eventdate->date < $start) // prevent duplicating events crossing month boundaries
$found = $db->selectObject('event_cache','feed="'.$extgcalurl.'" AND event_id="'.$event_cache->event_id.'" AND eventdate='.$event_cache->eventdate);
if (!$found)
$db->insertObject($event_cache,'event_cache');
}
| CWE-89 | 0 |
public static function stripFolder($req_uri) {
$uri = Site::$url;
$folder = self::getFolder();
$uri2 = str_replace($folder, "", $req_uri);
// print_r($uri2);
return $uri2;
}
| CWE-89 | 0 |
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['require_login']) ? COMMENTS_REQUIRE_LOGIN : $this->params['require_login'];
// $require_approval = empty($this->params['require_approval']) ? COMMENTS_REQUIRE_APPROVAL : $this->params['require_approval'];
// $require_notification = empty($this->params['require_notification']) ? COMMENTS_REQUIRE_NOTIFICATION : $this->params['require_notification'];
// $notification_email = empty($this->params['notification_email']) ? COMMENTS_NOTIFICATION_EMAIL : $this->params['notification_email'];
$comment = new expComment($this->params['id']);
$comment->approved = $comment->approved == 1 ? 0 : 1;
if ($comment->approved) {
$this->sendApprovalNotification($comment,$this->params);
}
$comment->save();
expHistory::back();
} | CWE-89 | 0 |
public static function randpass($vars){
if(is_array($vars)){
$hash = sha1($vars['passwd'].SECURITY_KEY.$vars['userid']);
}else{
$hash = sha1($vars.SECURITY_KEY);
}
$hash = substr($hash, 5, 16);
$pass = md5($hash);
return $pass;
}
| CWE-89 | 0 |
function delete_option_master() {
global $db;
$masteroption = new option_master($this->params['id']);
// delete any implementations of this option master
$db->delete('option', 'option_master_id='.$masteroption->id);
$masteroption->delete('optiongroup_master_id=' . $masteroption->optiongroup_master_id);
//eDebug($masteroption);
expHistory::back();
} | CWE-89 | 0 |
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 |
$method = $this->request->get('_method', $this->query->get('_method', 'POST'));
if (\is_string($method)) {
$this->method = strtoupper($method);
}
}
}
} | CWE-89 | 0 |
static function author() {
return "Dave Leffler";
}
| CWE-89 | 0 |
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,
'filter' => $filter,
'title' => t('Remove a custom filter')
)));
} | CWE-639 | 9 |
private function dumpParameter($name)
{
if ($this->container->isCompiled() && $this->container->hasParameter($name)) {
$value = $this->container->getParameter($name);
$dumpedValue = $this->dumpValue($value, false);
if (!$value || !\is_array($value)) {
return $dumpedValue;
}
if (!preg_match("/\\\$this->(?:getEnv\('(?:\w++:)*+\w++'\)|targetDirs\[\d++\])/", $dumpedValue)) {
return sprintf("\$this->parameters['%s']", $name);
}
}
return sprintf("\$this->getParameter('%s')", $name);
} | CWE-89 | 0 |
static function isSearchable() {
return true;
}
| CWE-89 | 0 |
public function updateTab($id, $array)
{
if (!$id || $id == '') {
$this->setAPIResponse('error', 'id was not set', 422);
return null;
}
if (!$array) {
$this->setAPIResponse('error', 'no data was sent', 422);
return null;
}
$tabInfo = $this->getTabById($id);
if ($tabInfo) {
$array = $this->checkKeys($tabInfo, $array);
} else {
$this->setAPIResponse('error', 'No tab info found', 404);
return false;
}
if (array_key_exists('name', $array)) {
$array['name'] = htmlspecialchars($array['name']);
if ($this->isTabNameTaken($array['name'], $id)) {
$this->setAPIResponse('error', 'Tab name: ' . $array['name'] . ' is already taken', 409);
return false;
}
}
if (array_key_exists('default', $array)) {
if ($array['default']) {
$this->clearTabDefault();
}
}
$response = [
array(
'function' => 'query',
'query' => array(
'UPDATE tabs SET',
$array,
'WHERE id = ?',
$id
)
),
];
$this->setAPIResponse(null, 'Tab info updated');
$this->setLoggerChannel('Tab Management');
$this->logger->debug('Edited Tab Info for [' . $tabInfo['name'] . ']');
return $this->processQueries($response);
} | CWE-434 | 5 |
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($row['TYPE'], strpos($row['TYPE'], '('));
if (!$pos = strpos($row['TYPE'], ','))
$pos = strpos($row['TYPE'], ')');
else
$properties[strtoupper($row['FIELD'])]['SCALE'] = substr($row['TYPE'], $pos + 1);
$properties[strtoupper($row['FIELD'])]['SIZE'] = substr($row['TYPE'], strpos($row['TYPE'], '(') + 1, $pos);
if ($row['NULL'] != '')
$properties[strtoupper($row['FIELD'])]['NULL'] = "Y";
else
$properties[strtoupper($row['FIELD'])]['NULL'] = "N";
}
break;
}
return $properties;
} | CWE-22 | 2 |
function getConfig($apikey){
$url = "http://api.themoviedb.org/3/configuration?api_key=".$apikey;
$config = $this->curl($url);
return $config;
}
| CWE-89 | 0 |
. "Stack trace:\n" . $exception->getTraceAsString();
} else {
$message = 'Error: ' . $exception->getMessage();
}
return $message;
} | CWE-79 | 1 |
public function actionPublishPost() {
$post = new Events;
// $user = $this->loadModel($id);
if (isset($_POST['text']) && $_POST['text'] != "") {
$post->text = $_POST['text'];
$post->visibility = $_POST['visibility'];
if (isset($_POST['associationId']))
$post->associationId = $_POST['associationId'];
//$soc->attributes = $_POST['Social'];
//die(var_dump($_POST['Social']));
$post->user = Yii::app()->user->getName();
$post->type = 'feed';
$post->subtype = $_POST['subtype'];
$post->lastUpdated = time();
$post->timestamp = time();
if ($post->save()) {
if (!empty($post->associationId) && $post->associationId != Yii::app()->user->getId()) {
$notif = new Notification;
$notif->type = 'social_post';
$notif->createdBy = $post->user;
$notif->modelType = 'Profile';
$notif->modelId = $post->associationId;
$notif->user = Yii::app()->db->createCommand()
->select('username')
->from('x2_users')
->where('id=:id', array(':id' => $post->associationId))
->queryScalar();
// $prof = X2Model::model('Profile')->findByAttributes(array('username'=>$post->user));
// $notif->text = "$prof->fullName posted on your profile.";
// $notif->record = "profile:$prof->id";
// $notif->viewed = 0;
$notif->createDate = time();
// $subject=X2Model::model('Profile')->findByPk($id);
// $notif->user = $subject->username;
$notif->save();
}
}
}
} | CWE-79 | 1 |
public function testPages()
{
\MicroweberPackages\Multilanguage\MultilanguageHelpers::setMultilanguageEnabled(false);
$this->browse(function (Browser $browser) {
$browser->within(new AdminLogin(), function ($browser) {
$browser->fillForm();
});
$routeCollection = Route::getRoutes();
foreach ($routeCollection as $value) {
if ($value->getActionMethod() == 'GET') {
continue;
}
if (strpos($value->uri(), 'admin') !== false) {
$browser->visit($value->uri());
$browser->within(new ChekForJavascriptErrors(), function ($browser) {
$browser->validate();
});
$browser->pause(2000);
}
}
});
} | CWE-601 | 11 |
public static function existConf () {
if(file_exists(GX_PATH.'/inc/config/config.php')){
return true;
}else{
return false;
}
}
| 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->flash->failure(t('Unable to remove this category.'));
}
$this->response->redirect($this->helper->url->to('CategoryController', 'index', array('project_id' => $project['id'])));
} | CWE-639 | 9 |
$text = sanitize_text_field($agent);
$agents[] = $text;
}
}
if (sizeof($agents) > 1)
{
sort( $agents );
$agents = array_unique($agents, SORT_STRING);
}
$banned_user_agent_data = implode(PHP_EOL, $agents);
$aio_wp_security->configs->set_value('aiowps_banned_user_agents',$banned_user_agent_data);
$_POST['aiowps_banned_user_agents'] = ''; //Clear the post variable for the banned address list
return 1;
}
| CWE-79 | 1 |
foreach ($page as $pageperm) {
if (!empty($pageperm['manage'])) return true;
}
| 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();
}
if ($this->tagModel->remove($tag_id)) {
$this->flash->success(t('Tag removed successfully.'));
} else {
$this->flash->failure(t('Unable to remove this tag.'));
}
$this->response->redirect($this->helper->url->to('ProjectTagController', 'index', array('project_id' => $project['id'])));
} | CWE-639 | 9 |
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 = $_FILES['file']['tmp_name'];
$targetPath = $this->root . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'userTabs' . DIRECTORY_SEPARATOR;
$this->makeDir($targetPath);
$targetFile = $targetPath . $_FILES['file']['name'];
$this->setAPIResponse(null, pathinfo($_FILES['file']['name'], PATHINFO_BASENAME) . ' has been uploaded', null);
return move_uploaded_file($tempFile, $targetFile);
}
} | CWE-79 | 1 |
public function backup($type='json')
{
global $DB;
global $website;
$out = array();
$DB->query('SELECT * FROM nv_feeds WHERE website = '.protect($website->id), 'object');
$out = $DB->result();
if($type='json')
$out = json_encode($out);
return $out;
}
| CWE-89 | 0 |
function update() {
global $db, $user;
$this->params['id'] = $db->selectValue('content_expRatings','expratings_id',"content_id='".$this->params['content_id']."' AND content_type='".$this->params['content_type']."' AND subtype='".$this->params['subtype']."' AND poster='".$user->id."'");
$msg = gt('Thank you for your rating');
$rating = new expRating($this->params);
if (!empty($rating->id)) $msg = gt('Your rating has been adjusted');
// save the rating
$rating->update($this->params);
// attach the rating to the datatype it belongs to (blog, news, etc..);
$obj = new stdClass();
$obj->content_type = $this->params['content_type'];
$obj->content_id = $this->params['content_id'];
$obj->expratings_id = $rating->id;
$obj->poster = $rating->poster;
if(isset($this->params['subtype'])) $obj->subtype = $this->params['subtype'];
$db->insertObject($obj, $rating->attachable_table);
$ar = new expAjaxReply(200,$msg);
$ar->send();
// flash('message', $msg);
// expHistory::back();
} | 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();
$newSecRef->module = $iloc->mod;
$newSecRef->source = $iloc->src;
$newSecRef->internal = '';
$newSecRef->refcount = 1;
// $newSecRef->is_original = 1;
$eloc = expUnserialize($container->external);
// $section = $db->selectObject('sectionref',"module='containermodule' AND source='".$eloc->src."'");
$section = $db->selectObject('sectionref',"module='container' AND source='".$eloc->src."'");
if (!empty($section)) {
$newSecRef->section = $section->id;
$db->insertObject($newSecRef,"sectionref");
$missing_sectionrefs[] = gt("Missing sectionref for container replaced").": ".$iloc->mod." - ".$iloc->src." - PageID #".$section->id;
} else {
$db->delete('container','id="'.$container->id.'"');
$missing_sectionrefs[] = gt("Cant' find the container page for container").": ".$iloc->mod." - ".$iloc->src.' - '.gt('deleted');
}
}
}
}
assign_to_template(array(
'missing_sectionrefs'=>$missing_sectionrefs,
));
} | CWE-89 | 0 |
public function manage() {
expHistory::set('viewable', $this->params);
$page = new expPaginator(array(
'model'=>'order_status',
'where'=>1,
'limit'=>10,
'order'=>'rank',
'page'=>(isset($this->params['page']) ? $this->params['page'] : 1),
'controller'=>$this->params['controller'],
'action'=>$this->params['action'],
//'columns'=>array('Name'=>'title')
));
assign_to_template(array(
'page'=>$page
));
} | CWE-89 | 0 |
public static function path($var) {
return GX_LIB.'Vendor/'.$var."/";
}
| 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'])) {
$this->flash->success(t('Custom filter removed successfully.'));
} else {
$this->flash->failure(t('Unable to remove this custom filter.'));
}
$this->response->redirect($this->helper->url->to('CustomFilterController', 'index', array('project_id' => $project['id'])));
} | CWE-639 | 9 |
private function getTaskLink()
{
$link = $this->taskLinkModel->getById($this->request->getIntegerParam('link_id'));
if (empty($link)) {
throw new PageNotFoundException();
}
return $link;
} | CWE-639 | 9 |
public function execute(&$params) {
$options = $this->config['options'];
$action = new Actions;
$action->subject = $this->parseOption('subject',$params);
$action->dueDate = $this->parseOption('dueDate',$params);
$action->actionDescription = $this->parseOption('description',$params);
$action->priority = $this->parseOption('priority',$params);
$action->visibility = $this->parseOption('visibility',$params);
if(isset($params['model']))
$action->assignedTo = $this->parseOption('assignedTo',$params);
// if(isset($this->config['attributes']))
// $this->setModelAttributes($action,$this->config['attributes'],$params);
if ($action->save()) {
return array (
true,
Yii::t('studio', "View created action: ").$action->getLink ());
} else {
return array(false, array_shift($action->getErrors()));
}
// if($this->parseOption('reminder',$params)) {
// $notif=new Notification;
// $notif->modelType='Actions';
// $notif->createdBy=Yii::app()->user->getName();
// $notif->modelId=$model->id;
// if($_POST['notificationUsers']=='me'){
// $notif->user=Yii::app()->user->getName();
// }else{
// $notif->user=$model->assignedTo;
// }
// $notif->createDate=$model->dueDate-($_POST['notificationTime']*60);
// $notif->type='action_reminder';
// $notif->save();
// if($_POST['notificationUsers']=='both' && Yii::app()->user->getName()!=$model->assignedTo){
// $notif2=new Notification;
// $notif2->modelType='Actions';
// $notif2->createdBy=Yii::app()->user->getName();
// $notif2->modelId=$model->id;
// $notif2->user=Yii::app()->user->getName();
// $notif2->createDate=$model->dueDate-($_POST['notificationTime']*60);
// $notif2->type='action_reminder';
// $notif2->save();
// }
// }
} | CWE-79 | 1 |
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 withoutHeader($header)
{
if (!$this->hasHeader($header)) {
return $this;
}
$new = clone $this;
$name = strtolower($header);
unset($new->headers[$name]);
foreach (array_keys($new->headerLines) as $key) {
if (strtolower($key) === $name) {
unset($new->headerLines[$key]);
}
}
return $new;
} | CWE-89 | 0 |
$controller = new $ctlname();
if (method_exists($controller,'isSearchable') && $controller->isSearchable()) {
// $mods[$controller->name()] = $controller->addContentToSearch();
$mods[$controller->searchName()] = $controller->addContentToSearch();
}
}
uksort($mods,'strnatcasecmp');
assign_to_template(array(
'mods'=>$mods
));
} | CWE-89 | 0 |
public function event()
{
$project = $this->getProject();
$values = $this->request->getValues();
if (empty($values['action_name']) || empty($values['project_id'])) {
return $this->create();
}
return $this->response->html($this->template->render('action_creation/event', array(
'values' => $values,
'project' => $project,
'available_actions' => $this->actionManager->getAvailableActions(),
'events' => $this->actionManager->getCompatibleEvents($values['action_name']),
)));
} | CWE-639 | 9 |
public static function restoreX2WebUser () {
if (isset (self::$_oldUserComponent)) {
Yii::app()->setComponent ('user', self::$_oldUserComponent);
} else {
throw new CException ('X2WebUser component could not be restored');
}
} | CWE-79 | 1 |
public function execute(&$params){
$action = new Actions;
$action->associationType = lcfirst(get_class($params['model']));
$action->associationId = $params['model']->id;
$action->subject = $this->parseOption('subject', $params);
$action->actionDescription = $this->parseOption('description', $params);
if($params['model']->hasAttribute('assignedTo'))
$action->assignedTo = $params['model']->assignedTo;
if($params['model']->hasAttribute('priority'))
$action->priority = $params['model']->priority;
if($params['model']->hasAttribute('visibility'))
$action->visibility = $params['model']->visibility;
if ($action->save()) {
return array (
true,
Yii::t('studio', "View created action: ").$action->getLink ()
);
} else {
return array(false, array_shift($action->getErrors()));
}
} | CWE-79 | 1 |
protected function moveVotes()
{
$sql = "SELECT * FROM package_proposal_votes WHERE pkg_prop_id = {$this->proposal}";
$res = $this->mdb2->query($sql);
if (MDB2::isError($res)) {
throw new RuntimeException("DB error occurred: {$res->getDebugInfo()}");
}
if ($res->numRows() == 0) {
return; // nothing to do
}
$insert = "INSERT INTO package_proposal_comments (";
$insert .= "user_handle, pkg_prop_id, timestamp, comment";
$insert .= ") VALUES(%s, {$this->proposal}, %d, %s)";
$delete = "DELETE FROM package_proposal_votes WHERE";
$delete .= " pkg_prop_id = {$this->proposal}";
$delete .= " AND user_handle = %s";
while ($row = $res->fetchRow(MDB2_FETCHMODE_OBJECT)) {
$comment = "Original vote: {$row->value}\n";
$comment .= "Conditional vote: " . (($row->is_conditional != 0)?'yes':'no') . "\n";
$comment .= "Comment on vote: " . $row->comment . "\n";
$comment .= "Reviewed: " . implode(", ", unserialize($row->reviews));
$sql = sprintf(
$insert,
$this->mdb2->quote($row->user_handle),
$row->timestamp,
$this->mdb2->quote($comment)
);
$this->queryChange($sql);
$sql = sprintf(
$delete,
$this->mdb2->quote($row->user_handle)
);
$this->queryChange($sql);
} | CWE-502 | 15 |
static function description() { return gt("Places navigation links/menus on the page."); }
| CWE-89 | 0 |
public static function admin () {
}
| CWE-89 | 0 |
public function getModuleItemString() {
$ret = $this->handler->_moduleName . '_' . $this->handler->_itemname;
return $ret;
}
| CWE-22 | 2 |
private function runCallback() {
foreach ($this->records as &$record) {
if (isset($record->ref_type)) {
$refType = $record->ref_type;
if (class_exists($record->ref_type)) {
$type = new $refType();
$classinfo = new ReflectionClass($type);
if ($classinfo->hasMethod('paginationCallback')) {
$item = new $type($record->original_id);
$item->paginationCallback($record);
}
}
}
}
} | CWE-89 | 0 |
function delete_option_master() {
global $db;
$masteroption = new option_master($this->params['id']);
// delete any implementations of this option master
$db->delete('option', 'option_master_id='.$masteroption->id);
$masteroption->delete('optiongroup_master_id=' . $masteroption->optiongroup_master_id);
//eDebug($masteroption);
expHistory::back();
} | CWE-89 | 0 |
private function getUrlencodedPrefix($string, $prefix)
{
if (0 !== strpos(rawurldecode($string), $prefix)) {
return false;
}
$len = strlen($prefix);
if (preg_match(sprintf('#^(%%[[:xdigit:]]{2}|.){%d}#', $len), $string, $match)) {
return $match[0];
}
return false;
} | CWE-89 | 0 |
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 $manage_all is moot w/ cascading perms now?
$manage_all = false;
if (expPermissions::check('manage', expCore::makeLocation('navigation', '', $id))) {
$manage_all = true;
}
//FIXME recode to use foreach $key=>$value
$navcount = count($nav);
for ($i = 0; $i < $navcount; $i++) {
if ($manage_all || expPermissions::check('manage', expCore::makeLocation('navigation', '', $nav[$i]->id))) {
$nav[$i]->manage = 1;
$view = true;
} else {
$nav[$i]->manage = 0;
$view = $nav[$i]->public ? true : expPermissions::check('view', expCore::makeLocation('navigation', '', $nav[$i]->id));
}
$nav[$i]->link = expCore::makeLink(array('section' => $nav[$i]->id), '', $nav[$i]->sef_name);
if (!$view) unset($nav[$i]);
}
$nav= array_values($nav);
// $nav[$navcount - 1]->last = true;
if (count($nav)) $nav[count($nav) - 1]->last = true;
// echo expJavascript::ajaxReply(201, '', $nav);
$ar = new expAjaxReply(201, '', $nav);
$ar->send();
}
| CWE-89 | 0 |
function rootQuery($db, $query) {
@ini_set('track_errors', 1); // @ - may be disabled
$file = @file_get_contents("$this->_url/?database=$db", false, stream_context_create(array('http' => array(
'method' => 'POST',
'content' => $this->isQuerySelectLike($query) ? "$query FORMAT JSONCompact" : $query,
'header' => 'Content-type: application/x-www-form-urlencoded',
'ignore_errors' => 1, // available since PHP 5.2.10
))));
if ($file === false) {
$this->error = $php_errormsg;
return $file;
}
if (!preg_match('~^HTTP/[0-9.]+ 2~i', $http_response_header[0])) {
$this->error = $file;
return false;
}
$return = json_decode($file, true);
if ($return === null) {
if (!$this->isQuerySelectLike($query) && $file === '') {
return true;
}
$this->errno = json_last_error();
if (function_exists('json_last_error_msg')) {
$this->error = json_last_error_msg();
} else {
$constants = get_defined_constants(true);
foreach ($constants['json'] as $name => $value) {
if ($value == $this->errno && preg_match('~^JSON_ERROR_~', $name)) {
$this->error = $name;
break;
}
}
}
}
return new Min_Result($return);
} | CWE-918 | 16 |
foreach ($grpusers as $u) {
$emails[$u->email] = trim(user::getUserAttribution($u->id));
}
| CWE-89 | 0 |
public static function isHadSub($parent, $menuid =''){
$sql = sprintf("SELECT * FROM `menus` WHERE `parent` = '%s' %s", $parent, $where);
} | CWE-79 | 1 |
foreach ($days as $event) {
if (empty($event->eventdate->date) || ($viewrange == 'upcoming' && $event->eventdate->date < time()))
break;
if (empty($event->eventstart))
$event->eventstart = $event->eventdate->date;
$extitem[] = $event;
}
| 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);
$section->parent = -1;
$db->updateObject($section, 'section');
expSession::clearAllUsersSessionCache('navigation');
expHistory::back();
} else {
notfoundController::handle_not_authorized();
}
}
| CWE-89 | 0 |
function(){function N(){d(K,X,function(){k(X);K.editComment(K.content,function(){p(X)},function(Q){l(X);N();b.handleError(Q,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}N()},K.isResolved),M(mxResources.get("delete"),function(){b.confirm(mxResources.get("areYouSure"),function(){k(X);K.deleteComment(function(N){if(!0===N){N=X.querySelector(".geCommentTxt");N.innerHTML="";mxUtils.write(N,mxResources.get("msgDeleted"));var Q=X.querySelectorAll(".geCommentAction");for(N= | CWE-79 | 1 |
$scope.deleteNode = function(node) {
bootbox.confirm('Are you sure you want to remove the node ' + node.nodeLabel + '?', function(ok) {
if (ok) {
RequisitionsService.startTiming();
RequisitionsService.deleteNode(node).then(
function() { // success
var index = -1;
for(var i = 0; i < $scope.filteredNodes.length; i++) {
if ($scope.filteredNodes[i].foreignId === node.foreignId) {
index = i;
}
}
if (index > -1) {
$scope.filteredNodes.splice(index,1);
}
growl.success('The node ' + node.nodeLabel + ' has been deleted.');
},
$scope.errorHandler
);
}
});
}; | CWE-79 | 1 |
function(d){var f="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=d&&0<window.location.search.length){var g="?",m;for(m in urlParams)0>mxUtils.indexOf(d,m)&&null!=urlParams[m]&&(f+=g+m+"="+urlParams[m],g="&")}else f=window.location.search;return f};EditorUi.prototype.getUrl=function(d){d=null!=d?d:window.location.pathname;var f=0<d.indexOf("?")?1:0;if("1"==urlParams.offline)d+=window.location.search;else{var g="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),
m;for(m in urlParams)0>mxUtils.indexOf(g,m)&&(d=0==f?d+"?":d+"&",null!=urlParams[m]&&(d+=m+"="+urlParams[m],f++))}return d};EditorUi.prototype.showLinkDialog=function(d,f,g,m,q){d=new LinkDialog(this,d,f,g,!0,m,q);this.showDialog(d.container,560,130,!0,!0);d.init()};EditorUi.prototype.getServiceCount=function(d){var f=1;null==this.drive&&"function"!==typeof window.DriveClient||f++;null==this.dropbox&&"function"!==typeof window.DropboxClient||f++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient|| | CWE-79 | 1 |
done = function(data) {
data.warning && self.error(data.warning);
cmd == 'open' && open($.extend(true, {}, data));
// fire some event to update cache/ui
data.removed && data.removed.length && self.remove(data);
data.added && data.added.length && self.add(data);
data.changed && data.changed.length && self.change(data);
// fire event with command name
self.trigger(cmd, data);
// force update content
data.sync && self.sync();
}, | CWE-89 | 0 |
a.sInfoThousands&&(a.sThousands=a.sInfoThousands);(a=a.sDecimal)&&db(a)}function eb(a){A(a,"ordering","bSort");A(a,"orderMulti","bSortMulti");A(a,"orderClasses","bSortClasses");A(a,"orderCellsTop","bSortCellsTop");A(a,"order","aaSorting");A(a,"orderFixed","aaSortingFixed");A(a,"paging","bPaginate");A(a,"pagingType","sPaginationType");A(a,"pageLength","iDisplayLength");A(a,"searching","bFilter");"boolean"===typeof a.sScrollX&&(a.sScrollX=a.sScrollX?"100%":"");"boolean"===typeof a.scrollX&&(a.scrollX=
a.scrollX?"100%":"");if(a=a.aoSearchCols)for(var b=0,c=a.length;b<c;b++)a[b]&&J(m.models.oSearch,a[b])}function fb(a){A(a,"orderable","bSortable");A(a,"orderData","aDataSort");A(a,"orderSequence","asSorting");A(a,"orderDataType","sortDataType");var b=a.aDataSort;b&&!h.isArray(b)&&(a.aDataSort=[b])}function gb(a){if(!m.__browser){var b={};m.__browser=b;var c=h("<div/>").css({position:"fixed",top:0,left:0,height:1,width:1,overflow:"hidden"}).append(h("<div/>").css({position:"absolute",top:1,left:1, | CWE-89 | 0 |
open : function() {
var dw = dialog.width() - 20;
(preview.width() > dw) && preview.width(dw);
pwidth = preview.width() - (rhandle.outerWidth() - rhandle.width());
pheight = preview.height() - (rhandle.outerHeight() - rhandle.height());
img.attr('src', src + (src.indexOf('?') === -1 ? '?' : '&')+'_='+Math.random());
imgc.attr('src', img.attr('src'));
imgr.attr('src', img.attr('src'));
} | CWE-89 | 0 |
$scope.save = function() {
var form = this.nodeForm;
RequisitionsService.startTiming();
RequisitionsService.saveNode($scope.node).then(
function() { // success
growl.success('The node ' + $scope.node.nodeLabel + ' has been saved.');
$scope.foreignId = $scope.node.foreignId;
form.$dirty = false;
},
$scope.errorHandler
);
}; | CWE-79 | 1 |
function pa(){mxEllipse.call(this)}function ua(){mxEllipse.call(this)}function ya(){mxRhombus.call(this)}function Fa(){mxEllipse.call(this)}function Ma(){mxEllipse.call(this)}function Oa(){mxEllipse.call(this)}function Qa(){mxEllipse.call(this)}function Ta(){mxActor.call(this)}function za(){mxActor.call(this)}function wa(){mxActor.call(this)}function Ea(c,l,x,p){mxShape.call(this);this.bounds=c;this.fill=l;this.stroke=x;this.strokewidth=null!=p?p:1;this.rectStyle="square";this.size=10;this.absoluteCornerSize= | CWE-79 | 1 |
_mouseCapture: function(event, overrideHandle) {
var currentItem = null,
validHandle = false,
that = this;
if (this.reverting) {
return false;
}
if(this.options.disabled || this.options.type === "static") {
return false;
}
//We have to refresh the items data once first
this._refreshItems(event);
//Find out if the clicked node (or one of its parents) is a actual item in this.items
$(event.target).parents().each(function() {
if($.data(this, that.widgetName + "-item") === that) {
currentItem = $(this);
return false;
}
});
if($.data(event.target, that.widgetName + "-item") === that) {
currentItem = $(event.target);
}
if(!currentItem) {
return false;
}
if(this.options.handle && !overrideHandle) {
$(this.options.handle, currentItem).find("*").addBack().each(function() {
if(this === event.target) {
validHandle = true;
}
});
if(!validHandle) {
return false;
}
}
this.currentItem = currentItem;
this._removeCurrentsFromItems();
return true;
}, | CWE-89 | 0 |
function usercheck_init(i) {
var obj = document.getElementById('ajax_output');
obj.innerHTML = '';
if (i.value.length < 1)
return;
var err = new Array();
if (i.value.match(/[^A-Za-z0-9_]/))
err[err.length] = 'Username can only contain letters, numbers and underscores';
if (i.value.length < 3)
err[err.length] = 'Username too short';
if (err != '') {
obj.style.color = '#ff0000';
obj.innerHTML = err.join('<br />');
return;
}
var pqr = i.value;
ajax_call('Validator.php?u=' + i.value + 'user', usercheck_callback, usercheck_error);
}
| CWE-22 | 2 |
this.update);this.refresh()};Format.prototype.clear=function(){this.container.innerHTML="";if(null!=this.panels)for(var a=0;a<this.panels.length;a++)this.panels[a].destroy();this.panels=[]};Format.prototype.refresh=function(){null!=this.pendingRefresh&&(window.clearTimeout(this.pendingRefresh),this.pendingRefresh=null);this.pendingRefresh=window.setTimeout(mxUtils.bind(this,function(){this.immediateRefresh()}))}; | CWE-94 | 14 |
T[N],"cells"),this.updateCustomLinkAction(u,T[N],"excludeCells")}};Graph.prototype.updateCustomLinkAction=function(u,E,J){if(null!=E&&null!=E[J]){for(var T=[],N=0;N<E[J].length;N++)if("*"==E[J][N])T.push(E[J][N]);else{var Q=u[E[J][N]];null!=Q?""!=Q&&T.push(Q):T.push(E[J][N])}E[J]=T}};Graph.prototype.getCellsForAction=function(u,E){E=this.getCellsById(u.cells).concat(this.getCellsForTags(u.tags,null,E));if(null!=u.excludeCells){for(var J=[],T=0;T<E.length;T++)0>u.excludeCells.indexOf(E[T].id)&&J.push(E[T]); | CWE-79 | 1 |
groups: function (next) {
if (!postData.groups) return next(null, [])
Group.getGroups(postData.groups, function (err, groups) {
if (err) return next(err)
async.each(
groups,
function (group, callback) {
group.addMember(savedId, function (err) {
if (err) return callback(err)
group.save(callback)
})
},
function (err) {
if (err) return next(err)
return next(null, groups)
}
)
})
}, | CWE-521 | 4 |
"checked"),O.style.visibility="visible"):A.setAttribute("checked","checked")):f=null}else f=null}catch(J){}x.style=y+(f?f:m());x.vertex=!0;l.addCell(x,null,null,null,null);l.selectAll();l.addListener(mxEvent.CELLS_MOVED,C);l.addListener(mxEvent.CELLS_RESIZED,C);var X=l.graphHandler.mouseUp,u=l.graphHandler.mouseDown;l.graphHandler.mouseUp=function(){X.apply(this,arguments);k.style.backgroundColor="#fff9"};l.graphHandler.mouseDown=function(){u.apply(this,arguments);k.style.backgroundColor=""};l.dblClick= | CWE-79 | 1 |
J.push(C);z.appendChild(C);var E=function(fa){Aa.style.display="none";ja.style.display="none";Z.style.left="30px";t(fa?-1:1);null==V&&(V=Ma);Z.scrollTop=0;Z.innerHTML="";R.spin(Z);var sa=function(xa,wa,ua){H=0;R.stop();Ma=xa;ua=ua||{};var va=0,ia;for(ia in ua)va+=ua[ia].length;if(wa)Z.innerHTML=wa;else if(0==xa.length&&0==va)Z.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams",null,"No Diagrams Found"));else if(Z.innerHTML="",0<va){Aa.style.display="";Z.style.left="160px";Aa.innerHTML="";
Ka=0;oa={"draw.io":xa};for(ia in ua)oa[ia]=ua[ia];B()}else O(!0)};fa?q(K.value,sa):p(sa)};p&&(C=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){E()}),z.appendChild(C),J.push(C));if(q){C=document.createElement("span");C.style.marginLeft="10px";C.innerHTML=mxUtils.htmlEntities(mxResources.get("search")+":");z.appendChild(C);var K=document.createElement("input");K.style.marginRight="10px";K.style.marginLeft="10px";K.style.width="220px";mxEvent.addListener(K,"keypress",function(fa){13== | CWE-79 | 1 |
Channel.prototype.destroy = function() {
this.end();
}; | CWE-78 | 6 |
labels: templateInstance.topTasks.get().map((task) => task._id),
datasets: [{
values: templateInstance.topTasks.get().map((task) => task.count),
}],
},
tooltipOptions: {
},
})
})
})
} | CWE-79 | 1 |
show: function(){
isatty && process.stdout.write('\u001b[?25h');
}, | CWE-89 | 0 |
qtip: Tine.Tinebase.common.doubleEncode(attr.name),
leaf: !!attr.account_grants,
allowDrop: !!attr.account_grants && attr.account_grants.addGrant
});
// copy 'real' data to container space
attr.container = Ext.copyTo({}, attr, Tine.Tinebase.Model.Container.getFieldNames());
}, | CWE-79 | 1 |
0,0,80,30,"ellipse");e(g)}finally{t.getModel().endUpdate()}if("horizontalTree"==l){var k=new mxCompactTreeLayout(t);k.edgeRouting=!1;k.levelDistance=30;D="edgeStyle=elbowEdgeStyle;elbow=horizontal;"}else"verticalTree"==l?(k=new mxCompactTreeLayout(t,!1),k.edgeRouting=!1,k.levelDistance=30,D="edgeStyle=elbowEdgeStyle;elbow=vertical;"):"radialTree"==l?(k=new mxRadialTreeLayout(t,!1),k.edgeRouting=!1,k.levelDistance=80):"verticalFlow"==l?k=new mxHierarchicalLayout(t,mxConstants.DIRECTION_NORTH):"horizontalFlow"==
l?k=new mxHierarchicalLayout(t,mxConstants.DIRECTION_WEST):"organic"==l?(k=new mxFastOrganicLayout(t,!1),k.forceConstant=80):"circle"==l&&(k=new mxCircleLayout(t));if(null!=k){var m=function(A,z){t.getModel().beginUpdate();try{null!=A&&A(),k.execute(t.getDefaultParent(),g)}catch(L){throw L;}finally{A=new mxMorphing(t),A.addListener(mxEvent.DONE,mxUtils.bind(this,function(){t.getModel().endUpdate();null!=z&&z()})),A.startAnimation()}},q=mxEdgeHandler.prototype.connect;mxEdgeHandler.prototype.connect=
function(A,z,L,M,n){q.apply(this,arguments);m()};t.resizeCell=function(){mxGraph.prototype.resizeCell.apply(this,arguments);m()};t.connectionHandler.addListener(mxEvent.CONNECT,function(){m()})}var v=mxUtils.button(mxResources.get("close"),function(){b.confirm(mxResources.get("areYouSure"),function(){null!=u.parentNode&&(t.destroy(),u.parentNode.removeChild(u));b.hideDialog()})});v.className="geBtn";b.editor.cancelFirst&&d.appendChild(v);var x=mxUtils.button(mxResources.get("insert"),function(A){t.clearCellOverlays(); | CWE-79 | 1 |
Toolbar.prototype.setFontName = function(value)
{
if (this.fontMenu != null)
{
this.fontMenu.innerHTML = '';
var div = document.createElement('div');
div.style.display = 'inline-block';
div.style.overflow = 'hidden';
div.style.textOverflow = 'ellipsis';
div.style.maxWidth = '66px';
mxUtils.write(div, value);
this.fontMenu.appendChild(div);
this.appendDropDownImageHtml(this.fontMenu);
}
}; | CWE-94 | 14 |
{sWrapper:"dataTables_wrapper form-inline dt-bootstrap",sFilterInput:"form-control input-sm",sLengthSelect:"form-control input-sm",sProcessing:"dataTables_processing panel panel-default"});d.ext.renderer.pageButton.bootstrap=function(a,h,r,m,j,n){var o=new d.Api(a),s=a.oClasses,k=a.oLanguage.oPaginate,t=a.oLanguage.oAria.paginate||{},f,g,p=0,q=function(d,e){var l,h,i,c,m=function(a){a.preventDefault();!b(a.currentTarget).hasClass("disabled")&&o.page()!=a.data.action&&o.page(a.data.action).draw("page")};
l=0;for(h=e.length;l<h;l++)if(c=e[l],b.isArray(c))q(d,c);else{g=f="";switch(c){case "ellipsis":f="…";g="disabled";break;case "first":f=k.sFirst;g=c+(0<j?"":" disabled");break;case "previous":f=k.sPrevious;g=c+(0<j?"":" disabled");break;case "next":f=k.sNext;g=c+(j<n-1?"":" disabled");break;case "last":f=k.sLast;g=c+(j<n-1?"":" disabled");break;default:f=c+1,g=j===c?"active":""}f&&(i=b("<li>",{"class":s.sPageButton+" "+g,id:0===r&&"string"===typeof c?a.sTableId+"_"+c:null}).append(b("<a>",{href:"#",
"aria-controls":a.sTableId,"aria-label":t[c],"data-dt-idx":p,tabindex:a.iTabIndex}).html(f)).appendTo(d),a.oApi._fnBindAction(i,{action:c},m),p++)}},i;try{i=b(h).find(e.activeElement).data("dt-idx")}catch(u){}q(b(h).empty().html('<ul class="pagination"/>').children("ul"),m);i&&b(h).find("[data-dt-idx="+i+"]").focus()};d.TableTools&&(b.extend(!0,d.TableTools.classes,{container:"DTTT btn-group",buttons:{normal:"btn btn-default",disabled:"disabled"},collection:{container:"DTTT_dropdown dropdown-menu", | CWE-89 | 0 |
App.Actions.DB.update_db_databasename_hint = function(elm, hint) {
if (hint.trim() == '') {
$(elm).parent().find('.hint').html('');
}
$(elm).parent().find('.hint').text(GLOBAL.DB_DBNAME_PREFIX + hint);
} | CWE-79 | 1 |
window.ocJSON=function(json){var jsonString=parse(json);return JSON.parse(jsonString);};}(window);+function($){"use strict";if($.oc===undefined) | CWE-79 | 1 |
function pa(){mxEllipse.call(this)}function ua(){mxEllipse.call(this)}function ya(){mxRhombus.call(this)}function Fa(){mxEllipse.call(this)}function Ma(){mxEllipse.call(this)}function Oa(){mxEllipse.call(this)}function Qa(){mxEllipse.call(this)}function Ta(){mxActor.call(this)}function za(){mxActor.call(this)}function wa(){mxActor.call(this)}function Ea(c,l,x,p){mxShape.call(this);this.bounds=c;this.fill=l;this.stroke=x;this.strokewidth=null!=p?p:1;this.rectStyle="square";this.size=10;this.absoluteCornerSize= | CWE-79 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.