code
stringlengths
12
2.05k
label_name
stringclasses
5 values
label
int64
0
4
function dump() { if (!$this->output) $this->output = fopen('php://output', 'w'); // Detect delimeter from the current locale settings. For locales // which use comma (,) as the decimal separator, the semicolon (;) // should be used as the field separator $deli...
Base
1
form_selectable_cell(filter_value($vdef['name'], get_request_var('filter'), 'vdef.php?action=edit&id=' . $vdef['id']), $vdef['id']); form_selectable_cell($disabled ? __('No'):__('Yes'), $vdef['id'], '', 'text-align:right'); form_selectable_cell(number_format_i18n($vdef['graphs'], '-1'), $vdef...
Base
1
public static function evaluate_search_tree($tree, $join = 'AND', $callback) { $matches = false; foreach($tree as $i => $el) { $b = false; if($i === 'AND' || $i === 'OR') { $b = self::evaluate_search_tree($el, $i, $callback); } else if(isset($el['query'])) { $b = call_user_func($callb...
Base
1
public function approve_submit() { if (empty($this->params['id'])) { flash('error', gt('No ID supplied for comment to approve')); expHistory::back(); } /* The global constants can be overriden by passing appropriate params */ //sure wish I could do this once in the...
Base
1
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
}elseif($k2 == ''){ $va = ['default']; }else{
Base
1
public static function canImportData() { return true; }
Class
2
public function __construct() { }
Base
1
foreach ($days as $value) { $regitem[] = $value; }
Base
1
protected function _joinPath($dir, $name) { return rtrim($dir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $name; }
Base
1
public function activate_address() { global $db, $user; $object = new stdClass(); $object->id = $this->params['id']; $db->setUniqueFlag($object, 'addresses', $this->params['is_what'], "user_id=" . $user->id); flash("message", gt("Successfully updated address.")); ...
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
public static function initializeNavigation() { $sections = section::levelTemplate(0, 0); return $sections; }
Base
1
public function admin_log($mode = '') { $errorLogPath = TMP . 'logs' . DS . 'error.log'; switch($mode) { case 'download': set_time_limit(0); if ($this->_downloadErrorLog()) { exit(); } $this->BcMessage->setInfo('γ‚¨γƒ©γƒΌγƒ­γ‚°γŒε­˜εœ¨γ—γΎγ›γ‚“γ€‚'); $this->redirect(['action' => 'log']); break; case ...
Base
1
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($...
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') ))); }
Class
2
public function showall() { expHistory::set('viewable', $this->params); $limit = (isset($this->config['limit']) && $this->config['limit'] != '') ? $this->config['limit'] : 10; if (!empty($this->params['view']) && ($this->params['view'] == 'showall_accordion' || $this->params['view'] == 'show...
Base
1
$result = $search->getSearchResults($item->query, false, true); if(empty($result) && !in_array($item->query, $badSearchArr)) { $badSearchArr[] = $item->query; $badSearch[$ctr2]['query'] = $item->query; $badSearch[$ctr2]['count'] = $db->countObjects("search_queries", "query='{$item->query}'"); $ct...
Class
2
public function getAmount() { $amount = $this->getParameter('amount'); if ($amount !== null) { // Don't allow integers for currencies that support decimals. // This is for legacy reasons - upgrades from v0.9 if ($this->getCurrencyDecimalPlaces() > 0) { ...
Base
1
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::S...
Base
1
function checkPassword($username, $password) { $doUser = OA_Dal::factoryDO('users'); $doUser->username = strtolower($username); $doUser->password = md5($password); $doUser->find(); if ($doUser->fetch()) { return $doUser; } else { return fa...
Class
2
function path_f ($path) { global $home_dir; $abs_dir = $home_dir; switch ($path) { case '.': case '': return realpath($abs_dir); } return realpath(realpath($home_dir) . "/$path"); }
Base
1
private function getSwimlane() { $swimlane = $this->swimlaneModel->getById($this->request->getIntegerParam('swimlane_id')); if (empty($swimlane)) { throw new PageNotFoundException(); } return $swimlane; }
Base
1
public static function stripFolder($req_uri) { $uri = Site::$url; $folder = self::getFolder(); $uri2 = str_replace($folder, "", $req_uri); // print_r($uri2); return $uri2; }
Base
1
function shibboleth_login_form() { $login_url = add_query_arg('action', 'shibboleth'); $login_url = remove_query_arg('reauth', $login_url); echo '<p id="shibboleth_login"><a href="' . $login_url . '">' . __('Login with Shibboleth', 'shibboleth') . '</a></p>'; }
Base
1
public function popupnewsitem($id) { $query = 'SELECT * FROM ' . TABLE_PREFIX .'news WHERE id=' . $id . ' '; return DB::get_row($query); }
Base
1
public function addSelect( $fields ) { if ( !is_array( $fields ) ) { throw new \MWException( __METHOD__ . ': A non-array was passed.' ); } foreach ( $fields as $alias => $field ) { if ( !is_numeric( $alias ) && array_key_exists( $alias, $this->select ) && $this->select[$alias] != $field ) { //In case o...
Class
2
return $fa->nameGlyph($icons, 'icon-'); } } else { return array(); } }
Base
1
$ok = $DB->execute(' INSERT INTO nv_paths (id, website, type, object_id, lang, path, cache_file, cache_expires, views) VALUES ( 0, :website, :type, :object_id, :lang, :path, "", 0, :views ) ', array( ':website' => $website_id, ':type' => $type, ':object_id' => $object...
Base
1
public function getItemLink(&$icmsObj, $onlyUrl=false) { /** * @todo URL Rewrite feature is not finished yet... */ //$seoMode = smart_getModuleModeSEO($this->handler->_moduleName); //$seoModuleName = smart_getModuleNameForSEO($this->handler->_moduleName); $seoMode = false; $seoModuleName = $this...
Base
1
static function displayname() { return gt("e-Commerce Category Manager"); }
Base
1
protected function getFile() { $task_id = $this->request->getIntegerParam('task_id'); $file_id = $this->request->getIntegerParam('file_id'); $model = 'projectFileModel'; if ($task_id > 0) { $model = 'taskFileModel'; $project_id = $this->taskFinderModel->g...
Class
2
public function breadcrumb() { global $sectionObj; expHistory::set('viewable', $this->params); $id = $sectionObj->id; $current = null; // Show not only the location of a page in the hierarchy but also the location of a standalone page $current = new secti...
Base
1
function unlockTables() { $sql = "UNLOCK TABLES"; $res = mysqli_query($this->connection, $sql); return $res; }
Base
1
protected function removeNetVolume($key) { $netVolumes = $this->getNetVolumes(); if (is_string($key) && isset($netVolumes[$key])) { unset($netVolumes[$key]); $this->saveNetVolumes($netVolumes); } }
Base
1
protected function __construct() { parent::__construct(); self::$locale = fusion_get_locale('', LOCALE.LOCALESET.'search.php'); }
Base
1
static function convertUTF($string) { return $string = str_replace('?', '', htmlspecialchars($string, ENT_IGNORE, 'UTF-8')); }
Class
2
public function getXForwardedForData() { return array( array(false, '10.0.0.1'), array('10.0.0.2', '10.0.0.2, 10.0.0.1'), array('10.0.0.2, 10.0.0.3', '10.0.0.2, 10.0.0.3, 10.0.0.1'), ); }
Class
2
$files[$key]->save(); } // eDebug($files,true); }
Class
2
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...
Class
2
public static function isHadSub($parent, $menuid =''){ $sql = sprintf("SELECT * FROM `menus` WHERE `parent` = '%s' %s", $parent, $where); }
Base
1
function html_escape_request_var($string) { return htmlspecialchars(get_request_var($string), ENT_QUOTES, 'UTF-8'); }
Base
1
public function update_version() { // get the current version $hv = new help_version(); $current_version = $hv->find('first', 'is_current=1'); // check to see if the we have a new current version and unset the old current version. if (!empty($this->params['is_current'])) { // $db...
Base
1
public function getChart($renderer, $id, $store_in_session = true) { $c = null; $chart_data = null; if ($renderer != null && $store_in_session) { $session = new Tracker_Report_Session($renderer->report->id); $session->changeSessionNamespace("renderers.{$r...
Class
2
public static function isPublic($s) { if ($s == null) { return false; } while ($s->public && $s->parent > 0) { $s = new section($s->parent); } $lineage = (($s->public) ? 1 : 0); return $lineage; }
Class
2
public function __construct($page, $file = null) { $this->page = $page; $this->file = $file; $this->blueprint = $page->blueprint(); $this->filename = $this->blueprint->files()->sanitize() ? '{safeFilename}' : '{filename}'; if($this->file) { $this->replace(); } else { $...
Base
1
$this->subtaskTimeTrackingModel->logEndTime($subtaskId, $this->userSession->getId()); $this->subtaskTimeTrackingModel->updateTaskTimeTracking($task['id']); }
Class
2
$expanded = implode($joiner, $kvp); if ($isAssoc) { // Don't prepend the value name when using the explode // modifier with an associative array. $actuallyUseQuery = false; } ...
Base
1
public function testCanTransformAndRetrievePartsIndividually() { $uri = (new Uri('')) ->withFragment('#test') ->withHost('example.com') ->withPath('path/123') ->withPort(8080) ->withQuery('?q=abc') ->withScheme('http') -...
Base
1
public function rules() { $rules = []; $inputs = $this->all(); $validateEmail = false; $validateUsername = false; if (!isset($inputs['username']) || !isset($inputs['email'])) { $validateUsername = true; } if (isset($inputs['email']) && !is...
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 )); }
Base
1
public function onKernelResponse(ResponseEvent $event) { if (!$event->isMainRequest()) { return; } $request = $event->getRequest(); if (!$request->hasSession() || !$request->attributes->get('_security_firewall_run', false)) { return; } i...
Class
2
public static function simple($input) { return empty($str) ? '' : pts_strings::keep_in_string($input, pts_strings::CHAR_LETTER | pts_strings::CHAR_NUMERIC | pts_strings::CHAR_DASH | pts_strings::CHAR_DECIMAL | pts_strings::CHAR_SPACE | pts_strings::CHAR_UNDERSCORE | pts_strings::CHAR_COMMA | pts_strings::CHAR_AT | ...
Compound
4
public function toolbar() { // global $user; $menu = array(); $dirs = array( BASE.'framework/modules/administration/menus', BASE.'themes/'.DISPLAY_THEME.'/modules/administration/menus' ); foreach ($dirs as $dir) { if (is_readable($dir)) { $dh = opendir($dir); while (...
Class
2
foreach($course_RET as $period_day) { $period_days_append_sql .="(sp.start_time<='$period_day[END_TIME]' AND '$period_day[START_TIME]'<=sp.end_time AND DAYS LIKE '%$period_day[DAYS]%') OR "; }
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 function isAllowedFilename($filename){ $allow_array = array( '.jpg','.jpeg','.png','.bmp','.gif','.ico','.webp', '.mp3','.wav','.mp4', '.mov','.webmv','.flac','.mkv', '.zip','.tar','.gz','.tgz','.ipa','.apk','.rar','.iso', '.pdf','.ofd','.swf','.epub','.xps', '.doc','.docx','.wps', '.ppt'...
Base
1
function singleQuoteReplace($param1 = false, $param2 = false, $param3) { return str_replace("'", "''", str_replace("\'", "'", $param3)); }
Base
1
public function testPopBeforeSmtpBad() { //Start a fake POP server on a different port //so we don't inadvertently connect to the previous instance $pid = shell_exec('nohup ./runfakepopserver.sh 1101 >/dev/null 2>/dev/null & printf "%u" $!'); $this->pids[] = $pid; sleep(...
Class
2
return "__NOTOC____NOEDITSECTION__" . \CategoryViewer::shortList( $articleLinks, $articleStartChars ); } return ''; }
Class
2
public function testResolvesUris($base, $rel, $expected) { $uri = new Uri($base); $actual = Uri::resolve($uri, $rel); $this->assertEquals($expected, (string) $actual); }
Base
1
function edit_externalalias() { $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 ...
Class
2
public function AddReplyTo($address, $name = '') { return $this->AddAnAddress('Reply-To', $address, $name); }
Base
1
function edit_internalalias() { $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 ...
Base
1
$return[$index] = strip_tags($value); if($return[$index] == 'zero') $return[$index] = '0'; } } elseif($type == ARG_MULTISTRING) { foreach($return as $index => $value) { $return[$index] = strip_tags($value); } } else $return = strip_tags($return); if(! empty($return) && $type == ARG_NUMERIC) {...
Class
2
public function StartTLS() { $this->error = null; # to avoid confusion if(!$this->connected()) { $this->error = array("error" => "Called StartTLS() without being connected"); return false; } fputs($this->smtp_conn,"STARTTLS" . $this->CRLF); $rply = $this->get_lines(); $code = su...
Class
2
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 delete() { global $db, $history; /* 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']) ? SIMPL...
Base
1
private function decryptContentEncryptionKey($private_key_or_secret) { switch ($this->header['alg']) { case 'RSA1_5': $rsa = $this->rsa($private_key_or_secret, RSA::ENCRYPTION_PKCS1); $this->content_encryption_key = $rsa->decrypt($this->jwe_encrypted_key); ...
Class
2
public function actionGetItems(){ $sql = 'SELECT id, name as value FROM x2_x2leads WHERE name LIKE :qterm ORDER BY name ASC'; $command = Yii::app()->db->createCommand($sql); $qterm = $_GET['term'].'%'; $command->bindParam(":qterm", $qterm, PDO::PARAM_STR); $result = $command-...
Class
2
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->...
Class
2
function _makeExtra($value, $title = '') { global $THIS_RET; if ($THIS_RET['WITH_TEACHER_ID']) $return .= ''._with.':&nbsp;' . GetTeacher($THIS_RET['WITH_TEACHER_ID']) . '<BR>'; if ($THIS_RET['NOT_TEACHER_ID']) $return .= ''._notWith.':&nbsp;' . GetTeacher($THIS_RET['NOT_TEACHER_ID']) . '<B...
Base
1
function PMA_linkURL($url) { if (!preg_match('#^https?://#', $url) || defined('PMA_SETUP')) { return $url; } if (!function_exists('PMA_URL_getCommon')) { include_once './libraries/url_generating.lib.php'; } $params = array(); $params['url'] = $url; $url = PMA_URL_getCommon(...
Class
2
static function displayname() { return gt("Navigation"); }
Base
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)...
Base
1
private function isWindows() { return DIRECTORY_SEPARATOR !== '/'; }
Class
2
private function setFooter( $footer ) { if ( \DynamicPageListHooks::getDebugLevel() == 5 ) { $footer .= '</nowiki></pre>'; } $this->footer = $this->replaceVariables( $footer ); }
Class
2
public static function exist($cat) { $cat = Typo::int($cat); $sql = "SELECT `id` FROM `cat` WHERE `id` = '{$cat}' AND `type` = 'post'"; $q = Db::result($sql); // echo Db::$num_rows; if (Db::$num_rows > 0) { return true; } else { return fals...
Base
1
foreach ($grpusers as $u) { $emails[$u->email] = trim(user::getUserAttribution($u->id)); }
Base
1
} elseif ( $sSecLabel[0] == '{' ) { // Uses LST::includeTemplate() from LabeledSectionTransclusion extension to include templates from the page // primary syntax {template}suffix $template1 = trim( substr( $sSecLabel, 1, strpos( $sSecLabel, '}' ) - 1 ) ); $template2 = trim( str_replace( '}', '',...
Class
2
echo '<LANGUAGE>' . htmlentities($value_arr['LANGUAGE']) . '</LANGUAGE>'; foreach ($value_arr['ENROLLMENT_INFO'] as $eid => $ed) { echo '<ENROLLMENT_INFO_' . htmlentities($eid) . '>'; echo '<SCHOOL_ID>' . htmlentitie...
Base
1
function editEvent($selected_events, $queue, $comments) { global $database_ged; // get all needed infos into variables $value_parts = explode(":", $selected_events); $id = $value_parts[0]; $ged_type = $value_parts[1]; // format comment string to avoid errors $comments = str_replace("'", "\'", $comments); $com...
Base
1
public function confirm() { $task = $this->getTask(); $link_id = $this->request->getIntegerParam('link_id'); $link = $this->taskExternalLinkModel->getById($link_id); if (empty($link)) { throw new PageNotFoundException(); } $this->response->html($this...
Base
1
$contents = ['form' => tep_draw_form('countries', 'countries.php', 'page=' . $_GET['page'] . '&action=insert')];
Base
1
public function getMailingVoucher($id) { trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be private with 5.8.', __CLASS__, __METHOD__), E_USER_DEPRECATED); $sql = 'SELECT value FROM s_campaigns_containers WHERE type=? AND promotionID=?'; $voucherID = Shopware()->D...
Base
1
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
public function testResource() { $stream = Psr7\stream_for('foo'); $handle = StreamWrapper::getResource($stream); $this->assertSame('foo', fread($handle, 3)); $this->assertSame(3, ftell($handle)); $this->assertSame(3, fwrite($handle, 'bar')); $this->assertSame(0, ...
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
foreach ($page as $pageperm) { if (!empty($pageperm['manage'])) return true; }
Class
2
public static function remove($var) { unset($_SESSION['gxsess']['val'][$var]); }
Base
1
function searchName() { return gt("Calendar Event"); }
Class
2
public function show() { $task = $this->getTask(); $subtask = $this->getSubtask(); $this->response->html($this->template->render('subtask_converter/show', array( 'subtask' => $subtask, 'task' => $task, ))); }
Base
1
static function description() { return gt("Places navigation links/menus on the page."); }
Class
2
function insertObject($object, $table) { //if ($table=="text") eDebug($object,true); $sql = "INSERT INTO `" . $this->prefix . "$table` ("; $values = ") VALUES ("; foreach (get_object_vars($object) as $var => $val) { //We do not want to save any fields that start with an ...
Base
1
$bdd->exec($sql); } } }
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
protected function getSubtask() { $subtask = $this->subtaskModel->getById($this->request->getIntegerParam('subtask_id')); if (empty($subtask)) { throw new PageNotFoundException(); } return $subtask; }
Base
1
public function getAuthority() { if (empty($this->host)) { return ''; } $authority = $this->host; if (!empty($this->userInfo)) { $authority = $this->userInfo . '@' . $authority; } if ($this->isNonStandardPort($this->scheme, $this->host, $...
Base
1
function selectObjectBySql($sql) { //$logFile = "C:\\xampp\\htdocs\\supserg\\tmp\\queryLog.txt"; //$lfh = fopen($logFile, 'a'); //fwrite($lfh, $sql . "\n"); //fclose($lfh); $res = @mysqli_query($this->connection, $this->injectProof($sql)); if ($re...
Base
1
$row_rub = sql_fetsel("id_rubrique", "spip_rubriques", "lang='" . $GLOBALS['spip_lang'] . "' AND id_parent=$id_parent"); if ($row_rub) { $row['id_rubrique'] = $row_rub['id_rubrique']; } } } } return $row; }
Base
1