diff --git "a/test.jsonl" "b/test.jsonl" --- "a/test.jsonl" +++ "b/test.jsonl" @@ -1,1153 +1,1153 @@ -{"code": "function layout_navbar() {\n\t$t_logo_url = config_get('logo_url');\n\n\techo '
';\n}", "label_name": "CWE-79", "label": 79} -{"code": "function PMA_importAjaxStatus($id)\n{\n header('Content-type: application/json');\n echo json_encode(\n $_SESSION[$GLOBALS['SESSION_KEY']]['handler']::getUploadStatus($id)\n );\n}", "label_name": "CWE-79", "label": 79} -{"code": "function get_abs_item($dir, $item) {\t\t// get absolute file+path\n\treturn get_abs_dir($dir).DIRECTORY_SEPARATOR.$item;\n}", "label_name": "CWE-22", "label": 22} -{"code": " function get_allowed_files_extensions_for_upload($fileTypes = 'images', $returnAsArray = false)\n {\n\n $are_allowed = '';\n switch ($fileTypes) {\n\n case 'img':\n case 'image':\n case 'images':\n $are_allowed .= ',png,gif,jpg,jpeg,tiff,bmp,svg,webp,ico';\n break;\n case 'audio':\n case 'audios':\n $are_allowed .= ',mp3,mp4,ogg,wav,flac';\n break;\n case 'video':\n case 'videos':\n $are_allowed .= ',avi,asf,mpg,mpeg,mp4,flv,mkv,webm,ogg,ogv,3gp,3g2,wma,mov,wmv';\n break;\n case 'file':\n case 'files':\n $are_allowed .= ',css,json,zip,gzip,csv,7z';\n break;\n case 'documents':\n case 'doc':\n $are_allowed .= ',doc,docx,pdf,odt,pages,rtf,txt,pps,ppt,pptx,xls,xlsx';\n break;\n case 'archives':\n case 'arc':\n case 'arch':\n $are_allowed .= ',zip,zipx,gzip,rar,gz,7z,cbr,tar.gz';\n break;\n case 'all':\n $are_allowed .= ',*';\n break;\n case '*':\n $are_allowed .= ',*';\n break;\n default:\n $are_allowed .= ',' . $fileTypes;\n }\n\n if($are_allowed){\n $are_allowed = explode(',',$are_allowed);\n array_unique($are_allowed);\n $are_allowed = array_filter($are_allowed);\n\n if ($returnAsArray) {\n return $are_allowed;\n }\n\n $are_allowed = implode(',', $are_allowed);\n }\n\n if ($returnAsArray) {\n return [];\n }\n\n return $are_allowed;\n }", "label_name": "CWE-79", "label": 79} -{"code": "function prepareExchangedData($data, $type)\n{\n global $SETTINGS;\n\n //load ClassLoader\n require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';\n //Load AES\n $aes = new SplClassLoader('Encryption\\Crypt', '../includes/libraries');\n $aes->register();\n\n if ($type == \"encode\") {\n if (isset($SETTINGS['encryptClientServer'])\n && $SETTINGS['encryptClientServer'] === \"0\"\n ) {\n return json_encode(\n $data,\n JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP\n );\n } else {\n return Encryption\\Crypt\\aesctr::encrypt(\n json_encode(\n $data,\n JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP\n ),\n $_SESSION['key'],\n 256\n );\n }\n } elseif ($type == \"decode\") {\n if (isset($SETTINGS['encryptClientServer'])\n && $SETTINGS['encryptClientServer'] === \"0\"\n ) {\n return json_decode(\n $data,\n true\n );\n } else {\n return json_decode(\n Encryption\\Crypt\\aesctr::decrypt(\n $data,\n $_SESSION['key'],\n 256\n ),\n true\n );\n }\n }\n}", "label_name": "CWE-434", "label": 434} -{"code": "function teampass_decrypt_pw($encrypted, $salt, $rand_key, $itcount = 2072)\n{\n $encrypted = base64_decode($encrypted);\n $pass_salt = substr($encrypted, -64);\n $encrypted = substr($encrypted, 0, -64);\n $key = teampass_pbkdf2_hash($salt, $pass_salt, $itcount, 16, 32);\n $iv = base64_decode(substr($encrypted, 0, 43) . '==');\n $encrypted = substr($encrypted, 43);\n $mac = substr($encrypted, -64);\n $encrypted = substr($encrypted, 0, -64);\n if ($mac !== hash_hmac('sha256', $encrypted, $salt)) return null;\n return substr(rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $encrypted, 'ctr', $iv), \"\\0\\4\"), strlen($rand_key));\n}", "label_name": "CWE-79", "label": 79} -{"code": "function teampass_whitelist() {\n $bdd = teampass_connect();\n\t$apiip_pool = teampass_get_ips();\n\tif (count($apiip_pool) > 0 && !array_search($_SERVER['REMOTE_ADDR'], $apiip_pool)) {\n\t\trest_error('IPWHITELIST');\n\t}\n}", "label_name": "CWE-89", "label": 89} -{"code": "function _getHtmlHeaderColumn($title, $name, $pageName, $entityIds, $listorder, $orderdirection, $showColumn = true)\n{\n $str = '';\n $entity = _getEntityString($entityIds);\n if ($listorder == $name) {\n if (($orderdirection == '') || ($orderdirection == 'down')) {\n $str = \"\";\n } else {\n $str = \"\";\n }\n }\n return $showColumn ? \"$title$str\" : '';\n}", "label_name": "CWE-79", "label": 79} -{"code": "function _getEntityString($entityIds)\n{\n $entity = '';\n if (!empty($entityIds)) {\n $entityArr = array();\n foreach ($entityIds as $entityId => $entityValue) {\n $entityArr[] = \"$entityId=$entityValue\";\n }\n $entity = implode('&',$entityArr) . '&';\n }\n\n return $entity;\n}", "label_name": "CWE-79", "label": 79} -{"code": " public function stripClean($str)\n {\n return $this->xssClean($this->stripTags($str));\n }", "label_name": "CWE-89", "label": 89} -{"code": " function ac_checkme($id, $name) {\n global $cms_db;\n\n $ret = true;\n $cquery = sprintf(\"select count(*) from %s where sid='%s' and name='%s'\",\n $cms_db['sessions'],\n $id,\n $name);\n $squery = sprintf(\"select sid from %s where sid = '%s' and name = '%s'\",\n $cms_db['sessions'],\n $id,\n addslashes($name));\n $this->db->query($squery);\n if ( $this->db->affected_rows() == 0\n && $this->db->query($cquery)\n\t && $this->db->next_record() && $this->db->f(0) == 0 ) {\n // nothing found here\n $ret = false;\n }\n return $ret;\n }", "label_name": "CWE-89", "label": 89} -{"code": " public static function error ($vars=\"\") {\n if( isset($vars) && $vars != \"\" ) {\n include(GX_PATH.'/inc/lib/Control/Error/'.$vars.'.control.php');\n }else{\n include(GX_PATH.'/inc/lib/Control/Error/404.control.php');\n }\n }", "label_name": "CWE-89", "label": 89} -{"code": " $q = self::$mysqli->query($vars) ;\n if($q === false) {\n user_error(\"Query failed: \".self::$mysqli->error.\"\n\t\t\t \n\t\t\tID );\n\t\t\techo wp_basename( $file );\n\t\t\t?>\n\t\t
\n\t\tprocess_fields( $table, $data, $format );\n\t\tif ( false === $data ) {\n\t\t\treturn false;\n\t\t}\n\t\t$where = $this->process_fields( $table, $where, $where_format );\n\t\tif ( false === $where ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$fields = $conditions = $values = array();\n\t\tforeach ( $data as $field => $value ) {\n\t\t\tif ( is_null( $value['value'] ) ) {\n\t\t\t\t$fields[] = \"`$field` = NULL\";\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$fields[] = \"`$field` = \" . $value['format'];\n\t\t\t$values[] = $value['value'];\n\t\t}\n\t\tforeach ( $where as $field => $value ) {\n\t\t\tif ( is_null( $value['value'] ) ) {\n\t\t\t\t$conditions[] = \"`$field` IS NULL\";\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$conditions[] = \"`$field` = \" . $value['format'];\n\t\t\t$values[] = $value['value'];\n\t\t}\n\n\t\t$fields = implode( ', ', $fields );\n\t\t$conditions = implode( ' AND ', $conditions );\n\n\t\t$sql = \"UPDATE `$table` SET $fields WHERE $conditions\";\n\t\t\n\t\t$this->check_current_query = false;\n\t\treturn $this->query( $this->prepare( $sql, $values ) );\n\t}", "label_name": "CWE-89", "label": 89} -{"code": " public function index($id)\n {\n\n //check permissions\n $template = $this->TemplateElement->Template->checkAuthorisation($id, $this->Auth->user(), false);\n if (!$this->_isSiteAdmin() && !$template) {\n throw new MethodNotAllowedException('No template with the provided ID exists, or you are not authorised to see it.');\n }\n\n $templateElements = $this->TemplateElement->find('all', array(\n 'conditions' => array(\n 'template_id' => $id,\n ),\n 'contain' => array(\n 'TemplateElementAttribute',\n 'TemplateElementText',\n 'TemplateElementFile'\n ),\n 'order' => array('TemplateElement.position ASC')\n ));\n $this->loadModel('Attribute');\n $this->set('validTypeGroups', $this->Attribute->validTypeGroups);\n $this->set('id', $id);\n $this->layout = 'ajaxTemplate';\n $this->set('elements', $templateElements);\n $mayModify = false;\n if ($this->_isSiteAdmin() || $template['Template']['org'] == $this->Auth->user('Organisation')['name']) {\n $mayModify = true;\n }\n $this->set('mayModify', $mayModify);\n $this->render('ajax/ajaxIndex');\n }", "label_name": "CWE-79", "label": 79} -{"code": "\t\t\tform_selectable_cell(filter_value($vdef['name'], get_request_var('filter'), 'vdef.php?action=edit&id=' . $vdef['id']), $vdef['id']);\n form_selectable_cell($disabled ? __('No'):__('Yes'), $vdef['id'], '', 'text-align:right');\n form_selectable_cell(number_format_i18n($vdef['graphs'], '-1'), $vdef['id'], '', 'text-align:right');\n form_selectable_cell(number_format_i18n($vdef['templates'], '-1'), $vdef['id'], '', 'text-align:right');\n form_checkbox_cell($vdef['name'], $vdef['id'], $disabled);\n form_end_row();\n }", "label_name": "CWE-79", "label": 79} -{"code": "\tpublic function meta_box_subject() {\n\n\t\t$placeholder = __( 'What is your conversation about?', 'supportflow' );\n\t\techo '' . __( 'Please describe what this ticket is about in several words', 'supportflow' ) . '
';\n\n\t}", "label_name": "CWE-79", "label": 79} -{"code": " foreach ($value as $valueKey => $valueValue) {\n if (\\is_int($valueKey)) {\n $filteredKey = $valueKey;\n } else {\n $filteredKey = self::filterValue($valueKey, $regex, $stripTags);\n }\n\n if ($filteredKey === '' || $filteredKey === null) {\n continue;\n }\n\n $filteredValue = $valueValue;\n\n if (\\is_array($valueValue)) {\n $filteredValue = self::filterArrayValue($valueValue, $regex, $stripTags);\n }\n\n if (\\is_string($valueValue)) {\n $filteredValue = self::filterValue($valueValue, $regex, $stripTags);\n }\n\n $newReturn[$filteredKey] = $filteredValue;\n }", "label_name": "CWE-79", "label": 79} -{"code": " public static function filterValue($value, $regex, $stripTags = true)\n {\n if (empty($value)) {\n return $value;\n }\n\n if ($stripTags) {\n $value = strip_tags($value);\n }\n\n if (preg_match($regex, $value)) {\n return null;\n }\n\n return $value;\n }", "label_name": "CWE-79", "label": 79} -{"code": " public function setArticles($articles)\n {\n $return = $this->setOneToMany($articles, Article::class, 'articles', 'container');\n $this->setType('ctArticles');\n\n return $return;\n }", "label_name": "CWE-79", "label": 79} -{"code": " public function buildCurrentUrl() {\n $url = URL_BASE;\n if ($this->url_style == 'sef') {\n $url .= substr(PATH_RELATIVE,0,-1).$this->sefPath;\n } else {\n $url .= urldecode((empty($_SERVER['REQUEST_URI'])) ? $_ENV['REQUEST_URI'] : $_SERVER['REQUEST_URI']);\n }\n return expString::sanitize($url);\n }", "label_name": "CWE-89", "label": 89} -{"code": " $module_views[$key]['name'] = gt($value['name']);\n }\n\n // look for a config form for this module's current view \n// $controller->loc->mod = expModules::getControllerClassName($controller->loc->mod);\n //check to see if hcview was passed along, indicating a hard-coded module\n// if (!empty($controller->params['hcview'])) {\n// $viewname = $controller->params['hcview'];\n// } else {\n// $viewname = $db->selectValue('container', 'view', \"internal='\".serialize($controller->loc).\"'\");\n// }\n// $viewconfig = $viewname.'.config';\n// foreach ($modpaths as $path) {\n// if (file_exists($path.'/'.$viewconfig)) {\n// $fileparts = explode('_', $viewname);\n// if ($fileparts[0]=='show'||$fileparts[0]=='showall') array_shift($fileparts);\n// $module_views[$viewname]['name'] = ucwords(implode(' ', $fileparts)).' '.gt('View Configuration');\n// $module_views[$viewname]['file'] =$path.'/'.$viewconfig;\n// }\n// }\n \n // sort the views highest to lowest by filename\n // we are reverse sorting now so our array merge\n // will overwrite property..we will run array_reverse\n // when we're finished to get them back in the right order\n krsort($common_views);\n krsort($module_views);\n\n if (!empty($moduleconfig)) $common_views = array_merge($common_views, $moduleconfig);\n $views = array_merge($common_views, $module_views);\n $views = array_reverse($views);\n\n return $views;\n}", "label_name": "CWE-89", "label": 89} -{"code": " function updateObject($object, $table, $where=null, $identifier='id', $is_revisioned=false) {\n\n if ($is_revisioned) {\n $object->revision_id++;\n //if ($table==\"text\") eDebug($object);\n $res = $this->insertObject($object, $table);\n //if ($table==\"text\") eDebug($object,true); \n $this->trim_revisions($table, $object->$identifier, WORKFLOW_REVISION_LIMIT);\n return $res;\n }\n $sql = \"UPDATE \" . $this->prefix . \"$table SET \";\n foreach (get_object_vars($object) as $var => $val) {\n //We do not want to save any fields that start with an '_'\n //if($is_revisioned && $var=='revision_id') $val++;\n if ($var{0} != '_') {\n if (is_array($val) || is_object($val)) {\n $val = serialize($val); \n $sql .= \"`$var`='\".$val.\"',\";\n } else {\n $sql .= \"`$var`='\" . $this->escapeString($val) . \"',\";\n }\n }\n }\n $sql = substr($sql, 0, -1) . \" WHERE \";\n if ($where != null)\n $sql .= $this->injectProof($where);\n else\n $sql .= \"`\" . $identifier . \"`=\" . $object->$identifier;\n //if ($table == 'text') eDebug($sql,true); \n $res = (@mysqli_query($this->connection, $sql) != false);\n return $res;\n }", "label_name": "CWE-89", "label": 89} -{"code": " private function runCallback() {\n foreach ($this->records as &$record) {\n if (isset($record->ref_type)) {\n $refType = $record->ref_type;\n if (class_exists($record->ref_type)) {\n $type = new $refType();\n $classinfo = new ReflectionClass($type);\n if ($classinfo->hasMethod('paginationCallback')) {\n $item = new $type($record->original_id);\n $item->paginationCallback($record);\n }\n }\n }\n } \n }", "label_name": "CWE-89", "label": 89} -{"code": " $count += $db->dropTable($basename);\n }\n \n flash('message', gt('Deleted').' '.$count.' '.gt('unused tables').'.');\n expHistory::back();\n }", "label_name": "CWE-89", "label": 89} -{"code": "\tpublic function fixsessions() {\n\t global $db;\n\n//\t\t$test = $db->sql('CHECK TABLE '.$db->prefix.'sessionticket');\n\t\t$fix = $db->sql('REPAIR TABLE '.$db->prefix.'sessionticket');\n\t\tflash('message', gt('Sessions Table was Repaired'));\n\t\texpHistory::back();\n\t}", "label_name": "CWE-89", "label": 89} -{"code": "\tpublic function fixsessions() {\n\t global $db;\n\n//\t\t$test = $db->sql('CHECK TABLE '.$db->prefix.'sessionticket');\n\t\t$fix = $db->sql('REPAIR TABLE '.$db->prefix.'sessionticket');\n\t\tflash('message', gt('Sessions Table was Repaired'));\n\t\texpHistory::back();\n\t}", "label_name": "CWE-89", "label": 89} -{"code": " public function toolbar() {\n// global $user;\n\n $menu = array();\n\t\t$dirs = array(\n\t\t\tBASE.'framework/modules/administration/menus',\n\t\t\tBASE.'themes/'.DISPLAY_THEME.'/modules/administration/menus'\n\t\t);\n\n\t\tforeach ($dirs as $dir) {\n\t\t if (is_readable($dir)) {\n\t\t\t $dh = opendir($dir);\n\t\t\t while (($file = readdir($dh)) !== false) {\n\t\t\t\t if (substr($file,-4,4) == '.php' && is_readable($dir.'/'.$file) && is_file($dir.'/'.$file)) {\n\t\t\t\t\t $menu[substr($file,0,-4)] = include($dir.'/'.$file);\n if (empty($menu[substr($file,0,-4)])) unset($menu[substr($file,0,-4)]);\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\t\t}\n\n // sort the top level menus alphabetically by filename\n\t\tksort($menu);\t\t\n\t\t$sorted = array();\n\t\tforeach($menu as $m) $sorted[] = $m;\n \n // slingbar position\n if (isset($_COOKIE['slingbar-top'])){\n $top = $_COOKIE['slingbar-top'];\n } else {\n $top = SLINGBAR_TOP;\n }\n \n\t\tassign_to_template(array(\n 'menu'=>(bs3()) ? $sorted : json_encode($sorted),\n \"top\"=>$top\n ));\n }", "label_name": "CWE-89", "label": 89} -{"code": " public function configure() {\n $this->config['defaultbanner'] = array();\n if (!empty($this->config['defaultbanner_id'])) {\n $this->config['defaultbanner'][] = new expFile($this->config['defaultbanner_id']);\n } \n\t parent::configure();\n\t $banners = $this->banner->find('all', null, 'companies_id');\n\t assign_to_template(array(\n 'banners'=>$banners,\n 'title'=>static::displayname()\n ));\n\t}", "label_name": "CWE-89", "label": 89} -{"code": " function reset_stats() {\n// global $db;\n\n // reset the counters\n// $db->sql ('UPDATE '.$db->prefix.'banner SET impressions=0 WHERE 1');\n banner::resetImpressions();\n// $db->sql ('UPDATE '.$db->prefix.'banner SET clicks=0 WHERE 1');\n banner::resetClicks();\n \n // let the user know we did stuff. \n flash('message', gt(\"Banner statistics reset.\"));\n expHistory::back();\n }", "label_name": "CWE-89", "label": 89} -{"code": "\tfunction edit() {\n\t if (empty($this->params['content_id'])) {\n\t flash('message',gt('An error occurred: No content id set.'));\n expHistory::back(); \n\t } \n /* The global constants can be overridden by passing appropriate params */\n //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet\n// $require_login = empty($this->params['require_login']) ? COMMENTS_REQUIRE_LOGIN : $this->params['require_login'];\n// $require_approval = empty($this->params['require_approval']) ? COMMENTS_REQUIRE_APPROVAL : $this->params['require_approval'];\n// $require_notification = empty($this->params['require_notification']) ? COMMENTS_REQUIRE_NOTIFICATION : $this->params['require_notification'];\n// $notification_email = empty($this->params['notification_email']) ? COMMENTS_NOTIFICATION_EMAIL : $this->params['notification_email'];\n \n \n\t $id = empty($this->params['id']) ? null : $this->params['id'];\n\t $comment = new expComment($id);\n //FIXME here is where we might sanitize the comment before displaying/editing it\n\t\tassign_to_template(array(\n\t\t 'content_id'=>$this->params['content_id'],\n 'content_type'=>$this->params['content_type'],\n\t\t 'comment'=>$comment\n\t\t));\n\t}\t", "label_name": "CWE-89", "label": 89} -{"code": "\tpublic function approve() {\n\t expHistory::set('editable', $this->params);\n \n /* The global constants can be overriden by passing appropriate params */ \n //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet\n// $require_login = empty($this->params['require_login']) ? COMMENTS_REQUIRE_LOGIN : $this->params['require_login'];\n// $require_approval = empty($this->params['require_approval']) ? COMMENTS_REQUIRE_APPROVAL : $this->params['require_approval'];\n// $require_notification = empty($this->params['require_notification']) ? COMMENTS_REQUIRE_NOTIFICATION : $this->params['require_notification'];\n// $notification_email = empty($this->params['notification_email']) ? COMMENTS_NOTIFICATION_EMAIL : $this->params['notification_email'];\n\t \n\t if (empty($this->params['id'])) {\n\t flash('error', gt('No ID supplied for comment to approve'));\n\t expHistory::back();\n\t }\n\t \n\t $comment = new expComment($this->params['id']);\n\t assign_to_template(array(\n 'comment'=>$comment\n ));\n\t}", "label_name": "CWE-89", "label": 89} -{"code": " public function approve_submit() {\n global $history;\n \n if (empty($this->params['id'])) {\n flash('error', gt('No ID supplied for comment to approve'));\n $lastUrl = expHistory::getLast('editable');\n }\n \n /* The global constants can be overriden by passing appropriate params */ \n //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet\n $require_login = empty($this->params['require_login']) ? SIMPLENOTE_REQUIRE_LOGIN : $this->params['require_login'];\n $require_approval = empty($this->params['require_approval']) ? SIMPLENOTE_REQUIRE_APPROVAL : $this->params['require_approval'];\n $require_notification = empty($this->params['require_notification']) ? SIMPLENOTE_REQUIRE_NOTIFICATION : $this->params['require_notification'];\n $notification_email = empty($this->params['notification_email']) ? SIMPLENOTE_NOTIFICATION_EMAIL : $this->params['notification_email'];\n \n $simplenote = new expSimpleNote($this->params['id']);\n //FIXME here is where we might sanitize the note before approving it\n $simplenote->body = $this->params['body'];\n $simplenote->approved = $this->params['approved'];\n $simplenote->save();\n \n $lastUrl = makelink($history->history[$history->history['lasts']['type']][count($history->history[$history->history['lasts']['type']])-1]['params']);\n if (!empty($this->params['tab']))\n {\n $lastUrl .= \"#\".$this->params['tab'];\n }\n redirect_to($lastUrl);\n }", "label_name": "CWE-89", "label": 89} -{"code": " public function approve_submit() {\n global $history;\n \n if (empty($this->params['id'])) {\n flash('error', gt('No ID supplied for comment to approve'));\n $lastUrl = expHistory::getLast('editable');\n }\n \n /* The global constants can be overriden by passing appropriate params */ \n //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet\n $require_login = empty($this->params['require_login']) ? SIMPLENOTE_REQUIRE_LOGIN : $this->params['require_login'];\n $require_approval = empty($this->params['require_approval']) ? SIMPLENOTE_REQUIRE_APPROVAL : $this->params['require_approval'];\n $require_notification = empty($this->params['require_notification']) ? SIMPLENOTE_REQUIRE_NOTIFICATION : $this->params['require_notification'];\n $notification_email = empty($this->params['notification_email']) ? SIMPLENOTE_NOTIFICATION_EMAIL : $this->params['notification_email'];\n \n $simplenote = new expSimpleNote($this->params['id']);\n //FIXME here is where we might sanitize the note before approving it\n $simplenote->body = $this->params['body'];\n $simplenote->approved = $this->params['approved'];\n $simplenote->save();\n \n $lastUrl = makelink($history->history[$history->history['lasts']['type']][count($history->history[$history->history['lasts']['type']])-1]['params']);\n if (!empty($this->params['tab']))\n {\n $lastUrl .= \"#\".$this->params['tab'];\n }\n redirect_to($lastUrl);\n }", "label_name": "CWE-89", "label": 89} -{"code": " $db->insertObject($obj, 'expeAlerts_subscribers');\n }\n \n $count = count($this->params['ealerts']);\n \n if ($count > 0) {\n flash('message', gt(\"Your subscriptions have been updated. You are now subscriber to\").\" \".$count.' '.gt('E-Alerts.'));\n } else {\n flash('error', gt(\"You have been unsubscribed from all E-Alerts.\"));\n }\n \n expHistory::back();\n }", "label_name": "CWE-89", "label": 89} -{"code": " $db->insertObject($obj, 'expeAlerts_subscribers');\n }\n \n $count = count($this->params['ealerts']);\n \n if ($count > 0) {\n flash('message', gt(\"Your subscriptions have been updated. You are now subscriber to\").\" \".$count.' '.gt('E-Alerts.'));\n } else {\n flash('error', gt(\"You have been unsubscribed from all E-Alerts.\"));\n }\n \n expHistory::back();\n }", "label_name": "CWE-89", "label": 89} -{"code": "\tfunction manage() {\n\t global $db;\n\t \n\t expHistory::set('manageable', $this->params);\n//\t $classes = array();\n $dir = BASE.\"framework/modules/ecommerce/billingcalculators\";\n if (is_readable($dir)) {\n $dh = opendir($dir);\n while (($file = readdir($dh)) !== false) {\n if (is_file(\"$dir/$file\") && substr(\"$dir/$file\", -4) == \".php\") {\n include_once(\"$dir/$file\");\n $classname = substr($file, 0, -4);\n $id = $db->selectValue('billingcalculator', 'id', 'calculator_name=\"'.$classname.'\"');\n if (empty($id)) {\n// $calobj = null;\n $calcobj = new $classname();\n if ($calcobj->isSelectable() == true) {\n $obj = new billingcalculator(array(\n 'title'=>$calcobj->name(),\n// 'user_title'=>$calcobj->title,\n 'body'=>$calcobj->description(), \n 'calculator_name'=>$classname,\n 'enabled'=>false));\n $obj->save();\n }\n }\n }\n }\n }\n \n $bcalc = new billingcalculator();\n $calculators = $bcalc->find('all');\n assign_to_template(array(\n 'calculators'=>$calculators\n ));\n\t}", "label_name": "CWE-89", "label": 89} -{"code": "\tfunction manage() {\n\t global $db;\n\t \n\t expHistory::set('manageable', $this->params);\n//\t $classes = array();\n $dir = BASE.\"framework/modules/ecommerce/billingcalculators\";\n if (is_readable($dir)) {\n $dh = opendir($dir);\n while (($file = readdir($dh)) !== false) {\n if (is_file(\"$dir/$file\") && substr(\"$dir/$file\", -4) == \".php\") {\n include_once(\"$dir/$file\");\n $classname = substr($file, 0, -4);\n $id = $db->selectValue('billingcalculator', 'id', 'calculator_name=\"'.$classname.'\"');\n if (empty($id)) {\n// $calobj = null;\n $calcobj = new $classname();\n if ($calcobj->isSelectable() == true) {\n $obj = new billingcalculator(array(\n 'title'=>$calcobj->name(),\n// 'user_title'=>$calcobj->title,\n 'body'=>$calcobj->description(), \n 'calculator_name'=>$classname,\n 'enabled'=>false));\n $obj->save();\n }\n }\n }\n }\n }\n \n $bcalc = new billingcalculator();\n $calculators = $bcalc->find('all');\n assign_to_template(array(\n 'calculators'=>$calculators\n ));\n\t}", "label_name": "CWE-89", "label": 89} -{"code": "\tfunction selectBillingOptions() {\n\t\t\n\t}", "label_name": "CWE-89", "label": 89} -{"code": " function configure() {\n expHistory::set('editable', $this->params);\n // little bit of trickery so that that categories can have their own configs\n \n $this->loc->src = \"@globalstoresettings\";\n $config = new expConfig($this->loc);\n $this->config = $config->config;\n $pullable_modules = expModules::listInstalledControllers($this->baseclassname, $this->loc);\n $views = expTemplate::get_config_templates($this, $this->loc);\n \n $gc = new geoCountry(); \n $countries = $gc->find('all');\n \n $gr = new geoRegion(); \n $regions = $gr->find('all');\n \n assign_to_template(array(\n 'config'=>$this->config,\n 'pullable_modules'=>$pullable_modules,\n 'views'=>$views,\n 'countries'=>$countries,\n 'regions'=>$regions,\n 'title'=>static::displayname()\n ));\n } ", "label_name": "CWE-89", "label": 89} -{"code": " function configure() {\n expHistory::set('editable', $this->params);\n // little bit of trickery so that that categories can have their own configs\n \n $this->loc->src = \"@globalstoresettings\";\n $config = new expConfig($this->loc);\n $this->config = $config->config;\n $pullable_modules = expModules::listInstalledControllers($this->baseclassname, $this->loc);\n $views = expTemplate::get_config_templates($this, $this->loc);\n \n $gc = new geoCountry(); \n $countries = $gc->find('all');\n \n $gr = new geoRegion(); \n $regions = $gr->find('all');\n \n assign_to_template(array(\n 'config'=>$this->config,\n 'pullable_modules'=>$pullable_modules,\n 'views'=>$views,\n 'countries'=>$countries,\n 'regions'=>$regions,\n 'title'=>static::displayname()\n ));\n } ", "label_name": "CWE-89", "label": 89} -{"code": " public function activate_discount(){ \n if (isset($this->params['id'])) {\n $discount = new discounts($this->params['id']);\n $discount->update($this->params);\n //if ($discount->discountulator->hasConfig() && empty($discount->config)) {\n //flash('messages', $discount->discountulator->name().' requires configuration. Please do so now.');\n //redirect_to(array('controller'=>'billing', 'action'=>'configure', 'id'=>$discount->id));\n //}\n }\n \n expHistory::back();\n }", "label_name": "CWE-89", "label": 89} -{"code": " public function activate_discount(){ \n if (isset($this->params['id'])) {\n $discount = new discounts($this->params['id']);\n $discount->update($this->params);\n //if ($discount->discountulator->hasConfig() && empty($discount->config)) {\n //flash('messages', $discount->discountulator->name().' requires configuration. Please do so now.');\n //redirect_to(array('controller'=>'billing', 'action'=>'configure', 'id'=>$discount->id));\n //}\n }\n \n expHistory::back();\n }", "label_name": "CWE-89", "label": 89} -{"code": "\t function manage_upcharge() {\n\t\t$this->loc->src = \"@globalstoresettings\";\n $config = new expConfig($this->loc);\n\t\t$this->config = $config->config;\n\n\t\t$gc = new geoCountry(); \n $countries = $gc->find('all');\n \n $gr = new geoRegion(); \n $regions = $gr->find('all',null,'rank asc,name asc');\n assign_to_template(array(\n 'countries'=>$countries,\n 'regions'=>$regions,\n 'upcharge'=>!empty($this->config['upcharge'])?$this->config['upcharge']:''\n ));\n\t }", "label_name": "CWE-89", "label": 89} -{"code": "\t function manage_upcharge() {\n\t\t$this->loc->src = \"@globalstoresettings\";\n $config = new expConfig($this->loc);\n\t\t$this->config = $config->config;\n\n\t\t$gc = new geoCountry(); \n $countries = $gc->find('all');\n \n $gr = new geoRegion(); \n $regions = $gr->find('all',null,'rank asc,name asc');\n assign_to_template(array(\n 'countries'=>$countries,\n 'regions'=>$regions,\n 'upcharge'=>!empty($this->config['upcharge'])?$this->config['upcharge']:''\n ));\n\t }", "label_name": "CWE-89", "label": 89} -{"code": " function edit_optiongroup_master() {\n expHistory::set('editable', $this->params);\n \n $id = isset($this->params['id']) ? $this->params['id'] : null;\n $record = new optiongroup_master($id); \n assign_to_template(array(\n 'record'=>$record\n ));\n }", "label_name": "CWE-89", "label": 89} -{"code": " public function search() {\n// global $db, $user;\n global $db;\n\n $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 \";\n $sql .= \"from \" . $db->prefix . \"addresses as a \"; //R JOIN \" . \n //$db->prefix . \"billingmethods as bm ON bm.addresses_id=a.id \";\n $sql .= \" WHERE match (a.firstname,a.lastname,a.email,a.organization) against ('\" . $this->params['query'] .\n \"*' IN BOOLEAN MODE) \";\n $sql .= \"order by match (a.firstname,a.lastname,a.email,a.organization) against ('\" . $this->params['query'] . \"*' IN BOOLEAN MODE) ASC LIMIT 12\";\n $res = $db->selectObjectsBySql($sql);\n foreach ($res as $key=>$record) {\n $res[$key]->title = $record->firstname . ' ' . $record->lastname;\n }\n //eDebug($sql);\n $ar = new expAjaxReply(200, gt('Here\\'s the items you wanted'), $res);\n $ar->send();\n }", "label_name": "CWE-89", "label": 89} -{"code": " function captureAuthorization() {\n //eDebug($this->params,true);\n $order = new order($this->params['id']);\n /*eDebug($this->params); \n //eDebug($order,true);*/\n //eDebug($order,true);\n //$billing = new billing();\n\n //eDebug($billing, true);\n //$billing->calculator = new $calcname($order->billingmethod[0]->billingcalculator_id);\n $calc = $order->billingmethod[0]->billingcalculator->calculator;\n $calc->config = $order->billingmethod[0]->billingcalculator->config;\n\n //$calc = new $calc-\n //eDebug($calc,true);\n if (!method_exists($calc, 'delayed_capture')) {\n flash('error', gt('The Billing Calculator does not support delayed capture'));\n expHistory::back();\n }\n\n $result = $calc->delayed_capture($order->billingmethod[0], $this->params['capture_amt'], $order);\n\n if (empty($result->errorCode)) {\n flash('message', gt('The authorized payment was successfully captured'));\n expHistory::back();\n\n } else {\n flash('error', gt('An error was encountered while capturing the authorized payment.') . '' . __('Login with Shibboleth', 'shibboleth') . '
';\n}", "label_name": "CWE-79", "label": 79} -{"code": " public function delete($fileName = null)\n {\n $this->validateFileName();\n\n list($name, $extension) = $this->model->getFileNameParts();\n\n return $this->datasource->delete(\n $this->model->getObjectTypeDirName(),\n $name,\n $extension\n );\n }", "label_name": "CWE-22", "label": 22} -{"code": " public function get($columns = ['*'])\n {\n if (!is_null($this->cacheMinutes)) {\n $results = $this->getCached($columns);\n }\n else {\n $results = $this->getFresh($columns);\n }\n\n $models = $this->getModels($results ?: []);\n\n return $this->model->newCollection($models);\n }", "label_name": "CWE-79", "label": 79} -{"code": "function sqlrequest($database,$sql,$id=false){\n\n\t// Get the global value\n\tglobal $database_host;\n\tglobal $database_username;\n\tglobal $database_password;\n\n\t$connexion = mysqli_connect($database_host, $database_username, $database_password, $database);\n\tif (!$connexion) {\n\t\techo \"' . __('Enter any positive or negative numerical value; to offset the download count shown to the visitors (when using the download counter shortcode).', 'simple-download-monitor') . '
';\n\techo '' . ProperDateAY($value) . ' |
' + message + '
Choose a scan option:
',\n inputType: 'radio',\n inputOptions: [\n {\n text: 'Scan all nodes',\n value: 'true',\n },\n {\n text: 'Scan added nodes only',\n value: 'false',\n },\n {\n text: 'No scanning',\n value: 'dbonly',\n }\n ],\n buttons: {\n confirm: {\n label: 'Synchronize',\n },\n cancel: {\n label: 'Cancel',\n }\n },\n swapButtonOrder: 'true',\n callback: function (result) {\n if (result !== null) {\n doSynchronize(requisition, result);\n }\n }\n });\n }", "label_name": "CWE-79", "label": 79} -{"code": " $scope.reset = function() {\n bootbox.confirm('Are you sure you want to reset the foreign source definition to the default ?', function(ok) {\n if (ok) {\n RequisitionsService.startTiming();\n RequisitionsService.deleteForeignSourceDefinition($scope.foreignSource).then(\n function() { // success\n growl.success('The foreign source definition for ' + $scope.foreignSource + 'has been reseted.');\n $scope.initialize();\n },\n $scope.errorHandler\n );\n }\n });\n };", "label_name": "CWE-79", "label": 79} -{"code": " $scope.refresh = function() {\n growl.success('Retrieving node ' + $scope.foreignId + ' from requisition ' + $scope.foreignSource + '...');\n RequisitionsService.getNode($scope.foreignSource, $scope.foreignId).then(\n function(node) { // success\n $scope.node = node;\n },\n $scope.errorHandler\n );\n };", "label_name": "CWE-79", "label": 79} -{"code": " $scope.save = function() {\n var form = this.nodeForm;\n RequisitionsService.startTiming();\n RequisitionsService.saveNode($scope.node).then(\n function() { // success\n growl.success('The node ' + $scope.node.nodeLabel + ' has been saved.');\n $scope.foreignId = $scope.node.foreignId;\n form.$dirty = false;\n },\n $scope.errorHandler\n );\n };", "label_name": "CWE-79", "label": 79} -{"code": " $scope.provision = function() {\n $scope.isSaving = true;\n growl.info($sanitize('The node ' + $scope.node.nodeLabel + ' is being added to requisition ' + $scope.node.foreignSource + '. Please wait...'));\n var successMessage = $sanitize('The node ' + $scope.node.nodeLabel + ' has been added to requisition ' + $scope.node.foreignSource);\n RequisitionsService.quickAddNode($scope.node).then(\n function() { // success\n $scope.reset();\n bootbox.dialog({\n message: successMessage,\n title: 'Success',\n buttons: {\n main: {\n label: 'Ok',\n className: 'btn-secondary'\n }\n }\n });\n },\n $scope.errorHandler\n );\n };", "label_name": "CWE-79", "label": 79} -{"code": " $scope.deleteNode = function(node) {\n bootbox.confirm('Are you sure you want to remove the node ' + node.nodeLabel + '?', function(ok) {\n if (ok) {\n RequisitionsService.startTiming();\n RequisitionsService.deleteNode(node).then(\n function() { // success\n var index = -1;\n for(var i = 0; i < $scope.filteredNodes.length; i++) {\n if ($scope.filteredNodes[i].foreignId === node.foreignId) {\n index = i;\n }\n }\n if (index > -1) {\n $scope.filteredNodes.splice(index,1);\n }\n growl.success('The node ' + node.nodeLabel + ' has been deleted.');\n },\n $scope.errorHandler\n );\n }\n });\n };", "label_name": "CWE-79", "label": 79} -{"code": " var doSynchronize = function(requisition, rescanExisting) {\n RequisitionsService.startTiming();\n RequisitionsService.synchronizeRequisition(requisition.foreignSource, rescanExisting).then(\n function() { // success\n growl.success('The import operation has been started for ' + requisition.foreignSource + ' (rescanExisting? ' + rescanExisting + ')' + translate('You have administration messages') + '
';\n for(var i = 0 ; i < messages.length; i++) {\n /* eslint-disable-next-line security/detect-object-injection */ // verified false positive\n var m = messages[i];\n const ago = Math.round((Date.now() - m.lastRecorded) / 60000);\n html += wrapmessage(translate(m.title), translate(m.message), m.count, ago, m.persistent);\n }\n } else {\n if (messageCount > 0) {\n html = wrapmessage(translate('Admin messages in queue'), translate('Please sign in using the API_SECRET to see your administration messages'));\n } else {\n html = wrapmessage(translate('Queue empty'), translate('There are no admin messages in queue'));\n }\n }\n html += '' + message + '
Choose a scan option:
',\n inputType: 'radio',\n inputOptions: [\n {\n text: 'Scan all nodes',\n value: 'true',\n },\n {\n text: 'Scan added nodes only',\n value: 'false',\n },\n {\n text: 'No scanning',\n value: 'dbonly',\n }\n ],\n buttons: {\n confirm: {\n label: 'Synchronize',\n },\n cancel: {\n label: 'Cancel',\n }\n },\n swapButtonOrder: 'true',\n callback: function (result) {\n if (result !== null) {\n doSynchronize(requisition, result);\n }\n }\n });\n }", "label_name": "CWE-79", "label": 1} +{"code": " $scope.reset = function() {\n bootbox.confirm('Are you sure you want to reset the foreign source definition to the default ?', function(ok) {\n if (ok) {\n RequisitionsService.startTiming();\n RequisitionsService.deleteForeignSourceDefinition($scope.foreignSource).then(\n function() { // success\n growl.success('The foreign source definition for ' + $scope.foreignSource + 'has been reseted.');\n $scope.initialize();\n },\n $scope.errorHandler\n );\n }\n });\n };", "label_name": "CWE-79", "label": 1} +{"code": " $scope.refresh = function() {\n growl.success('Retrieving node ' + $scope.foreignId + ' from requisition ' + $scope.foreignSource + '...');\n RequisitionsService.getNode($scope.foreignSource, $scope.foreignId).then(\n function(node) { // success\n $scope.node = node;\n },\n $scope.errorHandler\n );\n };", "label_name": "CWE-79", "label": 1} +{"code": " $scope.save = function() {\n var form = this.nodeForm;\n RequisitionsService.startTiming();\n RequisitionsService.saveNode($scope.node).then(\n function() { // success\n growl.success('The node ' + $scope.node.nodeLabel + ' has been saved.');\n $scope.foreignId = $scope.node.foreignId;\n form.$dirty = false;\n },\n $scope.errorHandler\n );\n };", "label_name": "CWE-79", "label": 1} +{"code": " $scope.provision = function() {\n $scope.isSaving = true;\n growl.info($sanitize('The node ' + $scope.node.nodeLabel + ' is being added to requisition ' + $scope.node.foreignSource + '. Please wait...'));\n var successMessage = $sanitize('The node ' + $scope.node.nodeLabel + ' has been added to requisition ' + $scope.node.foreignSource);\n RequisitionsService.quickAddNode($scope.node).then(\n function() { // success\n $scope.reset();\n bootbox.dialog({\n message: successMessage,\n title: 'Success',\n buttons: {\n main: {\n label: 'Ok',\n className: 'btn-secondary'\n }\n }\n });\n },\n $scope.errorHandler\n );\n };", "label_name": "CWE-79", "label": 1} +{"code": " $scope.deleteNode = function(node) {\n bootbox.confirm('Are you sure you want to remove the node ' + node.nodeLabel + '?', function(ok) {\n if (ok) {\n RequisitionsService.startTiming();\n RequisitionsService.deleteNode(node).then(\n function() { // success\n var index = -1;\n for(var i = 0; i < $scope.filteredNodes.length; i++) {\n if ($scope.filteredNodes[i].foreignId === node.foreignId) {\n index = i;\n }\n }\n if (index > -1) {\n $scope.filteredNodes.splice(index,1);\n }\n growl.success('The node ' + node.nodeLabel + ' has been deleted.');\n },\n $scope.errorHandler\n );\n }\n });\n };", "label_name": "CWE-79", "label": 1} +{"code": " var doSynchronize = function(requisition, rescanExisting) {\n RequisitionsService.startTiming();\n RequisitionsService.synchronizeRequisition(requisition.foreignSource, rescanExisting).then(\n function() { // success\n growl.success('The import operation has been started for ' + requisition.foreignSource + ' (rescanExisting? ' + rescanExisting + ')' + translate('You have administration messages') + '
';\n for(var i = 0 ; i < messages.length; i++) {\n /* eslint-disable-next-line security/detect-object-injection */ // verified false positive\n var m = messages[i];\n const ago = Math.round((Date.now() - m.lastRecorded) / 60000);\n html += wrapmessage(translate(m.title), translate(m.message), m.count, ago, m.persistent);\n }\n } else {\n if (messageCount > 0) {\n html = wrapmessage(translate('Admin messages in queue'), translate('Please sign in using the API_SECRET to see your administration messages'));\n } else {\n html = wrapmessage(translate('Queue empty'), translate('There are no admin messages in queue'));\n }\n }\n html += '