code
stringlengths
12
2.05k
label_name
stringclasses
5 values
label
int64
0
4
private static function isNonStandardPort($scheme, $host, $port) { if (!$scheme && $port) { return true; } if (!$host || !$port) { return false; } return !isset(static::$schemes[$scheme]) || $port !== static::$schemes[$scheme]; }
Base
1
public function remove() { $project = $this->getProject(); $this->checkCSRFParam(); $column_id = $this->request->getIntegerParam('column_id'); if ($this->columnModel->remove($column_id)) { $this->flash->success(t('Column removed successfully.')); } else { ...
Base
1
function render($mode, &$renderer, $data) { if($mode == 'xhtml') { global $conf; $id = $data[0]; $name = $data[1]; //prepare for formating $link['target'] = $conf['target']['wiki']; $link['style'] = ''; $link['p...
Base
1
public function getItems2 ( $prefix='', $page=0, $limit=20, $valueAttr='name', $nameAttr='name') { $modelClass = get_class ($this->owner); $model = CActiveRecord::model ($modelClass); $table = $model->tableName (); $offset = intval ($page) * intval ($limit); AuxLib:...
Class
2
foreach ($allgroups as $gid) { $g = group::getGroupById($gid); expPermissions::grantGroup($g, 'manage', $sloc); }
Base
1
recyclebin::sendToRecycleBin($loc, $parent); //FIXME if we delete the module & sectionref the module completely disappears // if (class_exists($secref->module)) { // $modclass = $secref->module; // //FIXME: more module/controller glue code // ...
Class
2
$modelNames[ucfirst($module->name)] = self::getModelTitle($modelName); } asort ($modelNames); if ($criteria !== null) { return $modelNames; } else { self::$_modelNames = $modelNames; } } retur...
Base
1
function selectBillingOptions() { }
Class
2
public function sdm_save_thumbnail_meta_data($post_id) { // Save Thumbnail Upload metabox if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return; if (!isset($_POST['sdm_thumbnail_box_nonce_check']) || !wp_verify_nonce($_POST['sdm_thumbnail_box_nonce_check'], 'sdm_thumbnail_box_nonce')) return; if (i...
Base
1
public static function add() { }
Base
1
public function getPopular(){ $url = "http://api.themoviedb.org/3/movie/popular?api_key=".$this->apikey; $popular = $this->curl($url); return $popular; }
Base
1
public function confirm() { $task = $this->getTask(); $comment = $this->getComment(); $this->response->html($this->template->render('comment/remove', array( 'comment' => $comment, 'task' => $task, 'title' => t('Remove a comment') ))); }
Base
1
$module_views[$key]['name'] = gt($value['name']); } // look for a config form for this module's current view // $controller->loc->mod = expModules::getControllerClassName($controller->loc->mod); //check to see if hcview was passed along, indicating a hard-coded module // if (!empty($contr...
Class
2
public function setLoggerChannel($channel = 'Organizr', $username = null) { if ($this->hasDB()) { $setLogger = false; if ($username) { $username = htmlspecialchars($username); } if ($this->logger) { if ($channel) { if (strtolower($this->logger->getChannel()) !== strtolower($channel)) { ...
Base
1
function update_upcharge() { $this->loc->src = "@globalstoresettings"; $config = new expConfig($this->loc); $this->config = $config->config; //This will make sure that only the country or region that given a rate value will be saved in the db $upcharge = array(); foreach($this->params['upch...
Base
1
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->c...
Base
1
$instance->processor = [0 => ${($_ = isset($this->services['App\Db']) ? $this->services['App\Db'] : $this->getDbService()) && false ?: '_'}, 1 => ${($_ = isset($this->services['App\Bus']) ? $this->services['App\Bus'] : $this->getBusService()) && false ?: '_'}];
Base
1
public function manage() { expHistory::set('manageable',$this->params); $gc = new geoCountry(); $countries = $gc->find('all'); $gr = new geoRegion(); $regions = $gr->find('all',null,'rank asc,name asc'); assign_to_template(array( ...
Base
1
public function __construct(public Config $Config, private Sql $Sql) { $this->Db = Db::getConnection(); }
Base
1
public function testCheckHTTP() { if (! function_exists('curl_init')) { $this->markTestSkipped('Missing curl extension!'); } $this->assertTrue( $this->object->checkHTTP("http://www.phpmyadmin.net/test/data") ); $this->assertContains( "T...
Class
2
$a = ${($_ = isset($this->services['App\Registry']) ? $this->services['App\Registry'] : $this->getRegistryService()) && false ?: '_'};
Base
1
public static function inc ($vars, $data = "") { $file = GX_PATH.'/gxadmin/inc/'.$vars.'.php'; if (file_exists($file)) { include($file); } }
Base
1
function edit_optiongroup_master() { expHistory::set('editable', $this->params); $id = isset($this->params['id']) ? $this->params['id'] : null; $record = new optiongroup_master($id); assign_to_template(array( 'record'=>$record )); }
Class
2
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, ...
Base
1
function VerifyVariableSchedule($columns) { // $teacher=$columns['TEACHER_ID']; // $secteacher=$columns['SECONDARY_TEACHER_ID']; // if($_REQUEST['tables']['course_periods'][$_REQUEST['course_period_id']]['TEACHER_ID']!='') // $all_teacher=$teacher.($secteacher!=''?','.$secteacher:''); // else // ...
Base
1
public function comments_count() { global $DB; if(empty($this->_comments_count)) { $DB->query(' SELECT COUNT(*) as total FROM nv_comments WHERE website = ' . protect($this->website) . ' ...
Base
1
public function AddCC($address, $name = '') { return $this->AddAnAddress('cc', $address, $name); }
Base
1
static function author() { return "Dave Leffler"; }
Base
1
function wp_embed_handler_youtube( $matches, $attr, $url, $rawattr ) { global $wp_embed; $embed = $wp_embed->autoembed( "https://youtube.com/watch?v={$matches[2]}" ); /** * Filters the YoutTube embed output. * * @since 4.0.0 * * @see wp_embed_handler_youtube() * * @param string $embed YouTube embed ...
Base
1
public static function isHadSub($parent, $menuid =''){ $sql = sprintf("SELECT * FROM `menus` WHERE `parent` = '%s' %s", $parent, $where); }
Base
1
$data .= '<input type="hidden" name="'.htmlspecialchars($key).'" value="'.htmlspecialchars($value).'" />'; } echo "<html><head><title>CSRF check failed</title></head> <body> <p>CSRF check failed. Your form session may have expired, or you may not have cookies enabled.</p> ...
Compound
4
private function __pullEvent($eventId, &$successes, &$fails, $eventModel, $server, $user, $jobId) { $event = $eventModel->downloadEventFromServer( $eventId, $server ); if (!empty($event)) { if ($this->__checkIfEventIsBlockedBeforePull($event)) ...
Class
2
public function __construct () { }
Base
1
public static function go($input, $path, $allowed='', $uniq=false, $size='', $width = '', $height = ''){ $filename = Typo::cleanX($_FILES[$input]['name']); $filename = str_replace(' ', '_', $filename); if(isset($_FILES[$input]) && $_FILES[$input]['error'] == 0){ if($uniq == true)...
Base
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...
Base
1
$removed[] = $fi->getFilename(); } if ($removed = implode(', ', $removed)) { $result .= $removed . ' ' . dgettext('tuleap-tracker', 'removed'); } $added = $this->fetchAddedFiles(array_diff($this->files, $changeset_value->getFiles()), $form...
Base
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...
Base
1
public static function BBCode2Html($text) { $text = trim($text); $text = self::parseEmoji($text); // Smileys to find... $in = array( ); // And replace them by... $out = array( ); $in[] = '[/*]'; $in[] = '[*]'; $out[] = '</li>'; $out[]...
Base
1
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...
Base
1
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...
Base
1
public function update_groupdiscounts() { global $db; if (empty($this->params['id'])) { // look for existing discounts for the same group $existing_id = $db->selectValue('groupdiscounts', 'id', 'group_id='.$this->params['group_id']); if (!empty($existing_id)) flashAndFlow('er...
Class
2
public static function dropdown($vars){ if(is_array($vars)){ //print_r($vars); $name = $vars['name']; $where = "WHERE "; if(isset($vars['type'])) { $where .= " `type` = '{$vars['type']}' AND "; }else{ $where .= " "; ...
Base
1
static function activate($uid, $karmalevel = 'pear.dev') { require_once 'Damblan/Karma.php'; global $dbh, $auth_user; $karma = new Damblan_Karma($dbh); $user = user::info($uid, null, 0); if (!isset($user['registered'])) { return false; } @$a...
Base
1
public function confirm() { $project = $this->getProject(); $category = $this->getCategory(); $this->response->html($this->helper->layout->project('category/remove', array( 'project' => $project, 'category' => $category, ))); }
Base
1
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)) { ...
Class
2
protected function getFoo2Service() { return $this->services['Foo\Foo'] = new \Foo\Foo(); }
Base
1
public function getQuerySelect() { $R1 = 'R1_' . $this->field->id; $R2 = 'R2_' . $this->field->id; $R3 = 'R3_' . $this->field->id; return "$R2.user_id AS `" . $this->field->name . "`"; }
Base
1
protected function _joinPath($dir, $name) { return rtrim($dir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $name; }
Base
1
$date->delete(); // event automatically deleted if all assoc eventdates are deleted } expHistory::back(); }
Base
1
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) ...
Base
1
public static function meta($cont_title='', $cont_desc='', $pre =''){ global $data; //print_r($data); //if(empty($data['posts'][0]->title)){ if(is_array($data) && isset($data['posts'][0]->title)){ $sitenamelength = strlen(Options::get('sitename')); ...
Base
1
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...
Base
1
function db_properties($table) { global $DatabaseType, $DatabaseUsername; switch ($DatabaseType) { case 'mysqli': $result = DBQuery("SHOW COLUMNS FROM $table"); while ($row = db_fetch_row($result)) { $properties[strtoupper($row['FIELD'])]['TYPE'] = strtoupper($ro...
Base
1
public function rules() { return [ 'sku' => ['required'], 'name' => ['required', Rule::unique('products')->ignore($this->segment(3))], 'quantity' => ['required', 'integer', 'min:0'], 'price' => ['required', 'numeric', 'min:0'], 'sale_price' => ...
Base
1
function searchName() { return gt('Webpage'); }
Base
1
public function updateAmazonOrderTracking($order_id, $courier_id, $courier_from_list, $tracking_no) { $this->db->query(" UPDATE `" . DB_PREFIX . "amazon_order` SET `courier_id` = '" . $courier_id . "', `courier_other` = " . (int)!$courier_from_list . ", `tracking_no` = '" . $tracking_no . "' WHERE `...
Base
1
function build_daterange_sql($timestamp, $endtimestamp=null, $field='date', $multiday=false) { if (empty($endtimestamp)) { $date_sql = "((".$field." >= " . expDateTime::startOfDayTimestamp($timestamp) . " AND ".$field." <= " . expDateTime::endOfDayTimestamp($timestamp) . ")"; } else {...
Base
1
public function pluginDetails() { return [ 'name' => 'Debugbar', 'description' => 'Debugbar integration for OctoberCMS.', 'author' => 'RainLab', 'icon' => 'icon-cog', 'homepage' => 'https://github.com/rainlab/debugbar-plug...
Base
1
function delete_selected() { $item = $this->event->find('first', 'id=' . $this->params['id']); if ($item && $item->is_recurring == 1) { $event_remaining = false; $eventdates = $item->eventdate[0]->find('all', 'event_id=' . $item->id); foreach ($eventdates as ...
Base
1
private function edebug($str) { if ($this->Debugoutput == "error_log") { error_log($str); } else { echo $str; } }
Class
2
function __construct(bool $connect = false) { global $CFG_GLPI; $options = [ 'base_uri' => GLPI_MARKETPLACE_PLUGINS_API_URI, 'connect_timeout' => self::TIMEOUT, ]; // add proxy string if configured in glpi if (!empty($CFG_GLPI["proxy_name"])) { $proxy...
Class
2
$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...
Class
2
public function validateForField(App\Request $request) { $fieldModel = Vtiger_Module_Model::getInstance($request->getModule())->getFieldByName($request->getByType('fieldName', 2)); if (!$fieldModel || !$fieldModel->isActiveField() || !$fieldModel->isViewEnabled()) { throw new \App\Exceptions\NoPermitted('ERR_N...
Base
1
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...
Base
1
public function confirm() { $task = $this->getTask(); $link = $this->getTaskLink(); $this->response->html($this->template->render('task_internal_link/remove', array( 'link' => $link, 'task' => $task, ))); }
Base
1
public function editTitle() { global $user; $file = new expFile($this->params['id']); if ($user->id==$file->poster || $user->isAdmin()) { $file->title = $this->params['newValue']; $file->save(); $ar = new expAjaxReply(200, gt('Your title was updated succes...
Base
1
$backup = ['sys' => $GLOBALS['TYPO3_CONF_VARS']['SYS'], 'server' => $_SERVER];
Variant
0
public function testReturnsIdentityWhenRemovingMissingHeader() { $r = new Response(); $this->assertSame($r, $r->withoutHeader('foo')); }
Base
1
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...
Base
1
protected function fsock_get_contents(&$url, $timeout, $redirect_max, $ua, $outfp) { $connect_timeout = 3; $connect_try = 3; $method = 'GET'; $readsize = 4096; $ssl = ''; $getSize = null; $headers = ''; $arr = parse_url($url); if (!$arr) ...
Base
1
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', nul...
Base
1
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...
Base
1
public static function v($vars) { $opt = self::$_data; // echo "<pre>"; foreach ($opt as $k => $v) { // echo $v->name; if ($v->name == $vars) { return $v->value; } } // echo "</pre>"; }
Base
1
public function pending() { // global $db; // make sure we have what we need. if (empty($this->params['id'])) expQueue::flashAndFlow('error', gt('Your subscriber ID was not supplied.')); // find the subscriber and their pending subscriptions $ealerts = expeAlerts::ge...
Class
2
public function testIdExceptionPhp53() { if (PHP_VERSION_ID >= 50400) { $this->markTestSkipped('Test skipped, for PHP 5.3 only.'); } $this->proxy->setActive(true); $this->proxy->setId('foo'); }
Base
1
public function verifyPhoneNumber(App\Request $request) { if ('phone' !== $this->fieldModel->getFieldDataType()) { throw new \App\Exceptions\NoPermitted('ERR_NO_PERMISSIONS_TO_FIELD'); } $response = new Vtiger_Response(); $data = ['isValidNumber' => false]; if ($request->isEmpty('phoneCountry', true)) { ...
Base
1
recyclebin::sendToRecycleBin($loc, $parent); //FIXME if we delete the module & sectionref the module completely disappears // if (class_exists($secref->module)) { // $modclass = $secref->module; // //FIXME: more module/controller glue code // ...
Base
1
static function displayname() { return "Events"; }
Class
2
protected function _move($source, $targetDir, $name) { $target = $this->_joinPath($targetDir, $name); $ret = @rename($source, $target) ? $target : false; $ret && clearstatcache(); return $ret; }
Base
1
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 (...
Base
1
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...
Base
1
public function manage_messages() { expHistory::set('manageable', $this->params); $page = new expPaginator(array( 'model'=>'order_status_messages', 'where'=>1, 'limit'=>10, 'order'=>'body', 'page'=>(isset($this->params['page']) ? $this->params['page'] : 1), ...
Base
1
public static function DragnDropReRank2() { global $router, $db; $id = $router->params['id']; $page = new section($id); $old_rank = $page->rank; $old_parent = $page->parent; $new_rank = $router->params['position'] + 1; // rank $new_parent = intval($r...
Class
2
public function edit(Request $request, $id) { return $this->view('post::admin.posts.edit', [ 'content_id'=>$id ]); }
Base
1
public function getQuerySelect() { $R1 = 'R1_' . $this->id; $R2 = 'R2_' . $this->id; return "$R2.value AS `" . $this->name . "`"; }
Base
1
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...
Base
1
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...
Base
1
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(...
Base
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...
Class
2
function PMA_countLines($filename) { global $LINE_COUNT; if (defined('LINE_COUNTS')) { return $LINE_COUNT[$filename]; } // ensure that the file is inside the phpMyAdmin folder $depath = 1; foreach (explode('/', $filename) as $part) { if ($part == '..') { $depath--; ...
Base
1
public function getAlpha($key, $default = '', $deep = false) { return preg_replace('/[^[:alpha:]]/', '', $this->get($key, $default, $deep)); }
Base
1
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)) { ...
Base
1
$section = new section(intval($page)); if ($section) { // self::deleteLevel($section->id); $section->delete(); } } }
Class
2
$this->subtaskTimeTrackingModel->logEndTime($subtaskId, $this->userSession->getId()); $this->subtaskTimeTrackingModel->updateTaskTimeTracking($task['id']); }
Base
1
public function getPageData() { $data = parent::getPageData(); $data['menu'] = 'admin'; $data['showonmenu'] = false; $data['title'] = 'options'; $data['icon'] = 'fas fa-wrench'; return $data; }
Base
1
function barcode_print($code, $encoding="ANY", $scale = 2 ,$mode = "png") { // DOLCHANGE LDR Add log dol_syslog("barcode.lib.php::barcode_print $code $encoding $scale $mode"); $bars=barcode_encode($code,$encoding); if (! $bars) { // DOLCHANGE LDR Return error message instead of array ...
Class
2
$a = ${($_ = isset($this->services['App\Processor']) ? $this->services['App\Processor'] : $this->getProcessorService()) && false ?: '_'};
Base
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...
Base
1
function dol_print_error($db='',$error='') { global $conf,$langs,$argv; global $dolibarr_main_prod; $out = ''; $syslog = ''; // Si erreur intervenue avant chargement langue if (! $langs) { require_once DOL_DOCUMENT_ROOT .'/core/class/translate.class.php'; $langs = new Translate('', $conf); $langs->load("...
Base
1
public function create_directory() { if (!AuthUser::hasPermission('file_manager_mkdir')) { Flash::set('error', __('You do not have sufficient permissions to create a directory.')); redirect(get_url('plugin/file_manager/browse/')); } // CSRF checks if ...
Class
2