code
stringlengths
12
2.05k
label_name
stringclasses
5 values
label
int64
0
4
function get_filedisplay_views() { expTemplate::get_filedisplay_views(); $paths = array( BASE.'framework/modules/common/views/file/', BASE.'themes/'.DISPLAY_THEME.'modules/common/views/file/', ); $views = array(); foreach ($paths as $path) { if (is_readable($path)) { ...
Base
1
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); ...
Class
2
public function disable() { $this->checkCSRFParam(); $project = $this->getProject(); $swimlane_id = $this->request->getIntegerParam('swimlane_id'); if ($this->swimlaneModel->disable($project['id'], $swimlane_id)) { $this->flash->success(t('Swimlane updated successful...
Base
1
function prepareInputForUpdate($input) { if (isset($input["rootdn_passwd"])) { if (empty($input["rootdn_passwd"])) { unset($input["rootdn_passwd"]); } else { $input["rootdn_passwd"] = Toolbox::encrypt(stripslashes($input["rootdn_passwd"]), ...
Class
2
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...
Base
1
function edit_option_master() { expHistory::set('editable', $this->params); $params = isset($this->params['id']) ? $this->params['id'] : $this->params; $record = new option_master($params); assign_to_template(array( 'record'=>$record )); }
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
public static function val ($vars) { $val = $_SESSION['gxsess']['val']; foreach ($val as $k => $v) { # code... switch ($k) { case $vars: return $v; break; default: ...
Base
1
$src = substr($ref->source, strlen($prefix)) . $section->id; if (call_user_func(array($ref->module, 'hasContent'))) { $oloc = expCore::makeLocation($ref->module, $ref->source); $nloc = expCore::makeLocation($ref->module, $src); if ($ref->module...
Base
1
public function getErrorMessage() { $vs_error_message = $this->opo_error_messages->get($this->opn_error_number); if ($vs_error_message) { return $vs_error_message; } else { return "Unknown error: ".$this->opn_error_number; } }
Base
1
public static function getParam($param, $post_id) { $sql = "SELECT * FROM `posts_param` WHERE `post_id` = '{$post_id}' AND `param` = '{$param}' LIMIT 1"; $q = Db::result($sql); if (Db::$num_rows > 0) { return $q[0]->value; }else{ return ''; } ...
Base
1
public function confirm() { $project = $this->getProject(); $tag_id = $this->request->getIntegerParam('tag_id'); $tag = $this->tagModel->getById($tag_id); $this->response->html($this->template->render('project_tag/remove', array( 'tag' => $tag, 'proje...
Base
1
public function showCredits() { ?> <p><strong><?php _e('Thank you very much for your donation', 'wp-piwik'); ?>:</strong> Marco L., Rolf W., Tobias U., Lars K., Donna F., Kevin D., Ramos S., Thomas M., John C., Andreas G., Ben M., Myra R. I., Carlos U. R.-S., Oleg I., M. N., Daniel K., James L., Jochen K., Cyril...
Base
1
public function testParsesProvidedUrl() { $uri = new Uri('https://michael:test@test.com:443/path/123?q=abc#test'); // Standard port 443 for https gets ignored. $this->assertEquals( 'https://michael:test@test.com/path/123?q=abc#test', (string) $uri ); ...
Base
1
public function __construct () { Session::start(); self::config('config'); new Db(); new Hooks(); Hooks::run('init'); new Options(); self::lang(Options::v('system_lang')); new Language(); new Site(); new Router(); V...
Base
1
foreach ($days as $value) { $regitem[] = $value; }
Class
2
private function getSwimlane() { $swimlane = $this->swimlaneModel->getById($this->request->getIntegerParam('swimlane_id')); if (empty($swimlane)) { throw new PageNotFoundException(); } return $swimlane; }
Base
1
function get_allowed_files_extensions_for_upload($fileTypes = 'images', $returnAsArray = false) { $are_allowed = ''; switch ($fileTypes) { case 'img': case 'image': case 'images': $are_allowed .= ',png,gif,jpg,jpeg,tiff,bmp,svg,webp,ico'; ...
Base
1
function captureAuthorization() { //eDebug($this->params,true); $order = new order($this->params['id']); /*eDebug($this->params); //eDebug($order,true);*/ //eDebug($order,true); //$billing = new billing(); //eDebug($billing, true); //$billing->calcul...
Class
2
function new_user() { global $db; $insert = $db->sql_query("INSERT INTO `mod_useronline` (`timestamp`, `ip`) VALUES ('mysql_real_escape_string($this->timestamp)', 'mysql_real_escape_string($this->ip)')"); if (!$insert) { $this->error[$this->i] = "Unable to record new visitor\r\n"; $this->i ++; ...
Base
1
function __construct () { }
Base
1
public function cloneGroup(TransactionGroup $group) { /** @var GroupCloneService $service */ $service = app(GroupCloneService::class); $newGroup = $service->cloneGroup($group); // event! event(new StoredTransactionGroup($newGroup)); app('preferences')->mark();...
Compound
4
public function from($dirName) { $this->from = $dirName; return $this; }
Base
1
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 = $_FI...
Base
1
function captureAuthorization() { //eDebug($this->params,true); $order = new order($this->params['id']); /*eDebug($this->params); //eDebug($order,true);*/ //eDebug($order,true); //$billing = new billing(); //eDebug($billing, true); //$billing->calcul...
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 IsMail() { $this->Mailer = 'mail'; }
Class
2
public function editspeed() { global $db; if (empty($this->params['id'])) return false; $calcname = $db->selectValue('shippingcalculator', 'calculator_name', 'id='.$this->params['id']); $calc = new $calcname($this->params['id']); assign_to_template(array( 'calculato...
Base
1
$contents[] = ['class' => 'text-center', 'text' => '<br>' . tep_draw_bootstrap_button(IMAGE_SAVE, 'fas fa-save', null, 'primary', null, 'btn-success xxx text-white mr-2') . tep_draw_bootstrap_button(IMAGE_CANCEL, 'fas fa-times', tep_href_link('languages.php', 'page=' . $_GET['page'] . '&lID=' . $lInfo->languages_...
Base
1
function db_case($array) { global $DatabaseType; $counter = 0; if ($DatabaseType == 'mysqli') { $array_count = count($array); $string = " CASE WHEN $array[0] ="; $counter++; $arr_count = count($array); for ($i = 1; $i < $arr_count; $i++) { $value = $array...
Base
1
function connect() { return $this->connectToServer($this->fields['host'], $this->fields['port'], $this->fields['rootdn'], Toolbox::decrypt($this->fields['rootdn_passwd'], GLPIKEY), $this->fields['use_tl...
Class
2
public function __construct() { self::$_data = self::load(); }
Base
1
$category_query = "select id from ".prefix_table("nested_tree")." where title LIKE '".$array_category[0]."' AND parent_id = 0"; } else { rest_error('NO_CATEGORY'); } // Delete item $response = DB::delete(prefix_tabl...
Base
1
public function disable() { $this->checkCSRFParam(); $project = $this->getProject(); $swimlane_id = $this->request->getIntegerParam('swimlane_id'); if ($this->swimlaneModel->disable($project['id'], $swimlane_id)) { $this->flash->success(t('Swimlane updated successful...
Base
1
public function __construct () { self::setActive(); }
Base
1
public static function post($vars) { switch (SMART_URL) { case true: # code... $url = Options::get('siteurl')."/".self::slug($vars)."/{$vars}"; break; default: # code... $url = Options::get('...
Base
1
$arcs['create']['application/x-rar'] = array('cmd' => ELFINDER_RAR_PATH, 'argc' => 'a -inul' . (defined('ELFINDER_RAR_MA4') && ELFINDER_RAR_MA4? ' -ma4' : ''), 'ext' => 'rar');
Base
1
protected function copy($src, $dst, $name) { $srcStat = $this->stat($src); $this->clearcache(); if (!empty($srcStat['thash'])) { $target = $this->decode($srcStat['thash']); if (!$this->inpathCE($target, $this->root)) { return $this->setError(elFinder::ERROR_COPY, $this->path($srcStat['hash']), elFin...
Base
1
protected function getSubtask() { $subtask = $this->subtaskModel->getById($this->request->getIntegerParam('subtask_id')); if (empty($subtask)) { throw new PageNotFoundException(); } return $subtask; }
Base
1
$link_text = wp_get_attachment_image( $_post->ID, $size, $icon, $attr ); } else { $link_text = ''; } if ( trim( $link_text ) == '' ) $link_text = $_post->post_title; /** * Filters a retrieved attachment page link. * * @since 2.7.0 * * @param string $link_html The page link HTML output. * @...
Base
1
public function __get($var) { switch ($var) { case 'configuration_array': $this->configuration_array = array(); if ($this->configuration != ''){ $jsonData = json_decode($this->configuration,true); if ($jsonData !== null) { ...
Class
2
public function IsHTML($ishtml = true) { if ($ishtml) { $this->ContentType = 'text/html'; } else { $this->ContentType = 'text/plain'; } }
Class
2
private function _csv_text($text) { $text = stripslashes(htmlspecialchars($text)); return $text; }
Base
1
$this->markTestSkipped('Function openssl_random_pseudo_bytes need LibreSSL version >=2.1.5 or Windows system on server'); } } static::$functions = $functions; // test various string lengths for ($length = 1; $length < 64; $length++) { $key1 = $th...
Class
2
public function setFrom($address, $name = '', $auto = true) { $address = trim($address); $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim if (!$this->validateAddress($address)) { $this->setError($this->lang('invalid_address') . ': ' . $address); ...
Compound
4
public function showall() { expHistory::set('viewable', $this->params); // figure out if should limit the results if (isset($this->params['limit'])) { $limit = $this->params['limit'] == 'none' ? null : $this->params['limit']; } else { $limit = (isset($this->co...
Base
1
public function save() { global $DB; if(!empty($this->id)) return $this->update(); else return $this->insert(); }
Base
1
public static function loader(){ $theme = Options::v('themes'); define('THEME', $theme); self::incFunc($theme); }
Base
1
function details($selected_events, $queue) { global $database_ged; // get all needed infos into variables $value_parts = explode(":", $selected_events); $id = $value_parts[0]; $ged_type = $value_parts[1]; $sql = "SELECT * FROM ".$ged_type."_queue_".$queue." WHERE id = $id"; $result = sqlrequest($database_ged, ...
Base
1
function delete_recurring() { $item = $this->event->find('first', 'id=' . $this->params['id']); if ($item->is_recurring == 1) { // need to give user options expHistory::set('editable', $this->params); assign_to_template(array( 'checked_date' => $this->par...
Base
1
public static function parseAndTrimImport($str, $isHTML = false) { //�Death from above�? � //echo "1<br>"; eDebug($str); // global $db; $str = str_replace("�", "&rsquo;", $str); $str = str_replace("�", "&lsquo;", $str); $str = str_replace("�", "&#174;", $str); $str = ...
Base
1
private function getTaskLink() { $link = $this->taskLinkModel->getById($this->request->getIntegerParam('link_id')); if (empty($link)) { throw new PageNotFoundException(); } return $link; }
Base
1
public function getDigits($key, $default = '', $deep = false) { // we need to remove - and + because they're allowed in the filter return str_replace(array('-', '+'), '', $this->filter($key, $default, FILTER_SANITIZE_NUMBER_INT, array(), $deep)); }
Base
1
private function filterScheme($scheme) { $scheme = strtolower($scheme); $scheme = rtrim($scheme, ':/'); return $scheme; }
Base
1
private function buildUri($uri, array $config) { if (!isset($config['base_uri'])) { return $uri instanceof UriInterface ? $uri : new Psr7\Uri($uri); } return Psr7\Uri::resolve(Psr7\uri_for($config['base_uri']), $uri); }
Base
1
function duplicate($options = []) { $input = $this->fields; unset($input['id']); if (is_array($options) && count($options)) { foreach ($options as $key => $val) { if (isset($this->fields[$key])) { $input[$key] = $val; } } } if ...
Base
1
function PMA_getColumnsList($db, $from=0, $num=25) { $cfgCentralColumns = PMA_centralColumnsGetParams(); if (empty($cfgCentralColumns)) { return array(); } $pmadb = $cfgCentralColumns['db']; $GLOBALS['dbi']->selectDb($pmadb, $GLOBALS['controllink']); $central_list_table = $cfgCentralColu...
Base
1
static public function getLastArchived($_num = 10, $_admin = 1) { if ($_num > 0) { $archived = array(); $counter = 0; $result_stmt = Database::prepare(" SELECT *, ( SELECT COUNT(`sub`.`id`) FROM `" . TABLE_PANEL_TICKETS . "` `sub` WHERE `sub`.`answerto` = `main`.`id` ) as `ticket_an...
Class
2
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_creat...
Class
2
public static function validateSignature(array $data, XMLSecurityKey $key) { assert('array_key_exists("Query", $data)'); assert('array_key_exists("SigAlg", $data)'); assert('array_key_exists("Signature", $data)'); $query = $data['Query']; $sigAlg = $data['SigAlg']; ...
Base
1
private function getFullOutput( $totalResults = false, $skipHeaderFooter = true ) { if ( !$skipHeaderFooter ) { $header = ''; $footer = ''; //Only override header and footers if specified. $_headerType = $this->getHeaderFooterType( 'header', $totalResults ); if ( $_headerType !== false ) { $header...
Class
2
public function deleteItem(){ $login_user = $this->checkLogin(); $this->checkAdmin(); $item_id = I("item_id/d"); $return = D("Item")->soft_delete_item($item_id); if (!$return) { $this->sendError(10101); }else{ $this->sendResult($return); ...
Compound
4
public function actionView($id){ // add media object to user's recent item list User::addRecentItem('m', $id, Yii::app()->user->getId()); $this->render('view', array( 'model' => $this->loadModel($id), )); }
Base
1
public function search_external() { // global $db, $user; global $db; $sql = "select DISTINCT(a.id) as id, a.source as source, a.firstname as firstname, a.middlename as middlename, a.lastname as lastname, a.organization as organization, a.email as email "; $sql .= "from " . $db->pref...
Base
1
protected function getComment() { $comment = $this->commentModel->getById($this->request->getIntegerParam('comment_id')); if (empty($comment)) { throw new PageNotFoundException(); } if (! $this->userSession->isAdmin() && $comment['user_id'] != $this->userSession->ge...
Base
1
public function admin_add() { $this->pageTitle = __d('baser', 'テーマアップロード'); $this->subMenuElements = ['themes']; if (!$this->request->is(['post', 'put'])) { return; } if ($this->Theme->isOverPostSize()) { $this->BcMessage->setError( __d( 'baser', '送信できるデータ量を超えています。合計で %s 以内のデータを送信してください...
Base
1
protected function addAnAddress($kind, $address, $name = '') { if (!preg_match('/^(to|cc|bcc|Reply-To)$/', $kind)) { $this->setError($this->lang('Invalid recipient array') . ': ' . $kind); $this->edebug($this->lang('Invalid recipient array') . ': ' . $kind); if ($this...
Compound
4
public function confirm() { $project = $this->getProject(); $this->response->html($this->helper->layout->project('column/remove', array( 'column' => $this->columnModel->getById($this->request->getIntegerParam('column_id')), 'project' => $project, ))); }
Base
1
public static function canImportData() { return true; }
Base
1
static function isSearchable() { return true; }
Base
1
function edit_order_item() { $oi = new orderitem($this->params['id'], true, true); if (empty($oi->id)) { flash('error', gt('Order item doesn\'t exist.')); expHistory::back(); } $oi->user_input_fields = expUnserialize($oi->user_input_fields); $params['o...
Class
2
function manage() { expHistory::set('viewable', $this->params); // $category = new storeCategory(); // $categories = $category->getFullTree(); // // // foreach($categories as $i=>$val){ // // if (!empty($this->values) && in_ar...
Base
1
public function testNameExceptionPhp54() { session_start(); $this->proxy->setName('foo'); }
Base
1
public function search() { // global $db, $user; global $db; $sql = "select DISTINCT(a.id) as id, a.firstname as firstname, a.middlename as middlename, a.lastname as lastname, a.organization as organization, a.email as email "; $sql .= "from " . $db->prefix . "addresses as a "; //R J...
Base
1
imagepng( $im_crop, $output ); } $new_avatar = false; if ( file_exists( $output ) ) { $old_avatar = get_user_meta( $user_id, '_lp_profile_picture', true ); if ( file_exists( $upload_dir['basedir'] . '/' . $old_avatar ) ) { @unlink( $upload_dir['basedir'] . '/' . $old_avatar ); } $new_avatar = preg_...
Class
2
protected function loadSelectedViewName() { $code = $this->request->get('code', ''); if (false === \strpos($code, '-')) { $this->selectedViewName = $code; return; } $parts = \explode('-', $code); $this->selectedViewName = empty($parts) ? $code : $...
Base
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...
Base
1
public function delete(Request $request, TransactionCurrency $currency) { /** @var User $user */ $user = auth()->user(); if (!$this->userRepository->hasRole($user, 'owner')) { $request->session()->flash('error', (string) trans('firefly.ask_site_owner', ['owner' => e(config('...
Compound
4
Contacts::model()->deleteAll($criteria); } } echo $model->id; } }
Base
1
static function author() { return "Dave Leffler"; }
Class
2
public static function getParent($parent='', $menuid = ''){ if(isset($menuid)){ $where = " AND `menuid` = '{$menuid}'"; }else{ $where = ''; } $sql = sprintf("SELECT * FROM `menus` WHERE `parent` = '%s' %s", $parent, $where); $menu = Db::result($sql); ...
Base
1
Contacts::model()->deleteAll($criteria); } } echo $model->id; } }
Class
2
public function getQuerySelect() { return $this->getBind()->getQuerySelect(); }
Base
1
public static function desc($vars){ if(!empty($vars)){ $desc = substr(strip_tags(htmlspecialchars_decode($vars).". ".Options::get('sitedesc')),0,150); }else{ $desc = substr(Options::get('sitedesc'),0,150); } return $desc; }
Base
1
protected function _rmdir($path) { return $this->query(sprintf('DELETE FROM %s WHERE id=%d AND mime="directory" LIMIT 1', $this->tbf, $path)) && $this->db->affected_rows; }
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
static public function onPost( $par, $out, $request ) { global $wgUser; if (!$request->getText('reason')) { $out->addHTML(Html::rawElement( 'p', [ 'class' => 'error '], wfMessage( 'report-error-missing-reason' )->escaped() )); } else { $dbw = wfGetDB( DB_MASTER ); $dbw->startAtomic(__METH...
Compound
4
public function rules() { $parentRules = parent::rules(); $parentRules[] = array( 'firstName,lastName', 'required', 'on' => 'webForm'); return $parentRules; }
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 delete(){ $item_id = I("item_id/d"); $login_user = $this->checkLogin(); $uid = $login_user['uid'] ; if(!$this->checkItemManage($uid , $item_id)){ $this->sendError(10303); return ; } $item_member_id = I("item_member_id/d"); ...
Compound
4
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_creat...
Base
1
public function approve_toggle() { global $history; if (empty($this->params['id'])) return; /* The global constants can be overriden by passing appropriate params */ //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet $r...
Base
1
public static function getItems($term) { $model = X2Model::model(Yii::app()->controller->modelClass); if (isset($model)) { $tableName = $model->tableName(); $sql = 'SELECT id, name as value FROM ' . $tableName . ' WHERE name LIKE :qterm ORDER BY name ASC'; ...
Class
2
function csrf_start() { if ($GLOBALS['csrf']['auto-session'] && session_status() == PHP_SESSION_NONE) { session_start(); } }
Compound
4
private function mail_passthru($to, $subject, $body, $header, $params) { if ( ini_get('safe_mode') || !($this->UseSendmailOptions) ) { $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($subject)), $body, $header); } else { $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($subjec...
Base
1
public static function returnChildrenAsJSON() { global $db; //$nav = section::levelTemplate(intval($_REQUEST['id'], 0)); $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; $nav = $db->selectObjects('section', 'parent=' . $id, 'rank'); //FIXME $m...
Base
1
public static function paginated_list($offset, $limit, $order_by_field, $order_by_ascdesc) { global $DB; global $website; $DB->queryLimit( '*', 'nv_block_groups', 'website = '.protect($website->id), $order_by_field.' '.$order_by_ascd...
Base
1
public static function country_name_by_code($code, $language="") { global $DB; $lang = core_get_language($language); $DB->query('SELECT name FROM nv_countries WHERE lang = '.protect($lang).' AND country_code = '.protect($code)); $row = $DB->first()...
Base
1
public function remove() { $this->checkCSRFParam(); $project = $this->getProject(); $tag_id = $this->request->getIntegerParam('tag_id'); $tag = $this->tagModel->getById($tag_id); if ($tag['project_id'] != $project['id']) { throw new AccessForbiddenException()...
Base
1
public static function getParent($id=''){ $sql = sprintf("SELECT `parent` FROM `cat` WHERE `id` = '%d'", $id); $cat = Db::result($sql); return $cat; }
Base
1