Database queries should use parameter binding

  • Critical
  • Security

More information: https://insight.sensiolabs.com/what-we-analyse/doctrine.database_query_contains_string_and_variable_concatenation

  1. 'varchar (' . $campo['caracteres'] . ') NULL DEFAULT "" '
  2. ));
  3. }
  4. }
  5. $colunm = ws::preventMySQLInject($campo['coluna_mysql']);
  6. $col = @mysqli_query($_conectMySQLi_,"SELECT ".$colunm. " FROM ".PREFIX_TABLES."_model_item");

    If provided by the user, the value of $colunm may allow an SQL injection attack. Avoid concatenating parameters to SQL query strings, and use parameter binding instead.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. if (!$col) {
  8. $s->add_column();
  9. }
  10. }
  11. }

Global variable or function should never be used 78

  • Major
  • Architecture

More information: https://insight.sensiolabs.com/what-we-analyse/php.use_global_variable_or_function

  1. ######################################
  2. # PREPARA INPUT PARA BASE
  3. ######################################
  4. public static function preventMySQLInject($string){
  5. global $_conectMySQLi_;

    $_conectMySQLi_ adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. $script = array('OR','FROM','SELECT','INSERT','DELETE','WHERE','DROP TABLE','SHOW TABLES','*','--','=');
  7. $string = (!get_magic_quotes_gpc()) ? addslashes(str_ireplace($script,"",$string)) : str_ireplace($script,"",$string);
  8. return mysqli_real_escape_string($_conectMySQLi_,$string);
  9. }
  1. ###################################################################################
  2. #
  3. ###################################################################################
  4. static function insertLog($id_user="",$id_ferramenta="" ,$id_item="",$linha="",$coluna="",$type="",$url="",$titulo="",$mensagem=""){
  5. global $_conectMySQLi_;

    $_conectMySQLi_ adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. ##############################################################################
  7. # INSERIMOS UM REGISTRO DE LOG
  8. ##############################################################################
  9. $_temp_ = new MySQL();
  10. $_temp_->set_table(PREFIX_TABLES.'ws_log');
  1. $_outPutCache = str_replace('{{rootPath}}', ws::rootPath, $_outPutCache);
  2. $_outPutCache = str_replace('{{includePath}}', ws::includePath, $_outPutCache);
  3. $_outPutCache = str_replace('{{domain}}', DOMINIO, $_outPutCache);
  4. ###################################################################
  5. function ReplaceImages($urlFull) {

    ReplaceImages() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. $tagIMG = $urlFull[0];
  7. $urlOriginal = $urlFull[1];
  8. if (substr($urlOriginal, 0, (strlen(ws::rootPath) + 7)) == ws::rootPath.'ws-img') {
  9. $urlOriginalSubs = substr($urlOriginal, 8);
  1. }
  2. public function slug($slug) {
  3. global $_conectMySQLi_;

    $_conectMySQLi_ adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  4. $pesquisa = mysqli_query($_conectMySQLi_, 'SELECT * FROM ' . PREFIX_TABLES . 'ws_ferramentas WHERE slug LIKE "' . $slug . '" ') or die(_erro(ws::GetDebugError(debug_backtrace(), mysqli_error($_conectMySQLi_))));
  5. $row = mysqli_num_rows($pesquisa);
  6. $result = mysqli_fetch_array($pesquisa);
  7. if (!is_string($slug)) {
  1. include_once(INCLUDE_PATH.'admin/app/lib/class-ws-v1.php');
  2. $user = new Session();
  3. function save_ws_lang($lang="pt-BR"){

    save_ws_lang() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  4. $config = file_get_contents(INCLUDE_PATH.'ws-config.php');
  5. $linhas = explode(PHP_EOL,$config);
  6. $newDoc = array();
  7. $i = 0;
  8. foreach ($linhas as $key => $value) {
  1. }
  2. file_put_contents(INCLUDE_PATH.'ws-config.php', implode($newDoc,PHP_EOL));
  3. }
  4. function substituiTopo() {

    substituiTopo() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  5. $U = new MySQL();
  6. $U->set_table(PREFIX_TABLES . 'setupdata');
  7. $U->set_where('id="1"');
  8. $U->set_update('imagem_topo', $_REQUEST['img']);
  9. if ($U->salvar()) {
  1. $U->set_update('imagem_topo', $_REQUEST['img']);
  2. if ($U->salvar()) {
  3. echo $_REQUEST['img'];
  4. }
  5. }
  6. function substituiSplash() {

    substituiSplash() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. $U = new MySQL();
  8. $U->set_table(PREFIX_TABLES . 'setupdata');
  9. $U->set_where('id="1"');
  10. $U->set_update('splash_img', $_REQUEST['img'][0]);
  11. if ($U->salvar()) {
  1. $this->piece_size = $new_piece_size;
  2. }
  3. }
  4. ########################################################################################### JUNTA PARTES
  5. function juntaPartes($file = "", $diretorio = "./") {

    juntaPartes() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. $folder = opendir($diretorio);
  7. $splitnum = 1;
  8. $fp = fopen($diretorio . "/" . $file, "w");
  9. while ($item = readdir($folder)) {
  10. if ($item != "." && $item != "..") {
  1. fclose($fp);
  2. }
  3. ###########################################################################################
  4. //http://websheep_producao.com/admin/app/ws-modules/ws-domain/functions.php?function=ClassFTP
  5. function ClassFTP() {

    ClassFTP() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. include('./FtpClient.php');
  7. $ftp = new FtpClient();
  8. $ftp->connect('ftp.websheep.com.br');
  9. $ftp->login('admin@websheep.com.br', base64_decode('aXNyYWZlbGl6'));
  10. //$ftp->createDirectory('/public_html/__WS__FILES__');
  1. //$ftp->rename($current, $new);
  2. }
  3. function enviaFTP() {

    enviaFTP() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  4. include('./FtpClient.php');
  5. //Marcador de início
  6. $ftp = new FTPClient();
  7. $ftp->connect('ftp.websheep.com.br', false, 21, 50);
  8. $ftp->login('admin@websheep.com.br', base64_decode('aXNyYWZlbGl6'));
  1. ftp_close($conn_id);
  2. /**/
  3. }
  4. function VerificaPacote() {

    VerificaPacote() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  5. global $_dir_theme_;
  6. global $_files_theme_;
  7. lista_Dir_theme("./../../.././");
  8. echo json_encode(array(
  9. 'file_exists' => file_exists('./FTP_Transfer.zip'),
  1. /**/
  2. }
  3. function VerificaPacote() {
  4. global $_dir_theme_;

    $_dir_theme_ adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  5. global $_files_theme_;
  6. lista_Dir_theme("./../../.././");
  7. echo json_encode(array(
  8. 'file_exists' => file_exists('./FTP_Transfer.zip'),
  9. 'pastas' => count($_dir_theme_),
  1. }
  2. function VerificaPacote() {
  3. global $_dir_theme_;
  4. global $_files_theme_;

    $_files_theme_ adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  5. lista_Dir_theme("./../../.././");
  6. echo json_encode(array(
  7. 'file_exists' => file_exists('./FTP_Transfer.zip'),
  8. 'pastas' => count($_dir_theme_),
  9. 'arquivos' => count($_files_theme_)
  1. 'pastas' => count($_dir_theme_),
  2. 'arquivos' => count($_files_theme_)
  3. ));
  4. }
  5. function salvaDominio() {

    salvaDominio() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. $inputs = array();
  7. parse_str($_REQUEST['inputs'], $inputs);
  8. if (empty($inputs['SMTP_Auth'])) {
  9. $inputs['SMTP_Auth'] = '0';
  10. } else {
  1. PREPARA TRANSFERÊNCIA
  2. **/
  3. $_dir_theme_ = array();
  4. $_files_theme_ = array();
  5. function lista_Dir_theme($diretorio, $admin = 0) {

    lista_Dir_theme() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. global $_dir_theme_;
  7. global $_files_theme_;
  8. $folder = opendir($diretorio);
  9. while ($item = readdir($folder)) {
  10. if ($item == '.' || $item == '..') {
  1. **/
  2. $_dir_theme_ = array();
  3. $_files_theme_ = array();
  4. function lista_Dir_theme($diretorio, $admin = 0) {
  5. global $_dir_theme_;

    $_dir_theme_ adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. global $_files_theme_;
  7. $folder = opendir($diretorio);
  8. while ($item = readdir($folder)) {
  9. if ($item == '.' || $item == '..') {
  10. continue;
  1. $_dir_theme_ = array();
  2. $_files_theme_ = array();
  3. function lista_Dir_theme($diretorio, $admin = 0) {
  4. global $_dir_theme_;
  5. global $_files_theme_;

    $_files_theme_ adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. $folder = opendir($diretorio);
  7. while ($item = readdir($folder)) {
  8. if ($item == '.' || $item == '..') {
  9. continue;
  10. }
  1. array_push($_files_theme_, $newDir);
  2. }
  3. }
  4. }
  5. }
  6. function delZIPtoFTP() {

    delZIPtoFTP() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. if (file_exists('./' . $_REQUEST['namefile'])) {
  8. unlink('./' . $_REQUEST['namefile']);
  9. }
  10. }
  1. if (file_exists('./' . $_REQUEST['namefile'])) {
  2. unlink('./' . $_REQUEST['namefile']);
  3. }
  4. }
  5. function CompactarZIPtoFTP() {

    CompactarZIPtoFTP() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. global $_dir_theme_;
  7. global $_files_theme_;
  8. global $_conectMySQLi_;
  9. $nome_bkp = '_bkp_website_' . date("m-d-y") . ".zip";
  10. ########################################################################################################################### compacta o Site e seu conteudo
  1. unlink('./' . $_REQUEST['namefile']);
  2. }
  3. }
  4. function CompactarZIPtoFTP() {
  5. global $_dir_theme_;

    $_dir_theme_ adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. global $_files_theme_;
  7. global $_conectMySQLi_;
  8. $nome_bkp = '_bkp_website_' . date("m-d-y") . ".zip";
  9. ########################################################################################################################### compacta o Site e seu conteudo
  10. $_dir_theme_ = array();
  1. }
  2. }
  3. function CompactarZIPtoFTP() {
  4. global $_dir_theme_;
  5. global $_files_theme_;

    $_files_theme_ adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. global $_conectMySQLi_;
  7. $nome_bkp = '_bkp_website_' . date("m-d-y") . ".zip";
  8. ########################################################################################################################### compacta o Site e seu conteudo
  9. $_dir_theme_ = array();
  10. $_files_theme_ = array();
  1. }
  2. function CompactarZIPtoFTP() {
  3. global $_dir_theme_;
  4. global $_files_theme_;
  5. global $_conectMySQLi_;

    $_conectMySQLi_ adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. $nome_bkp = '_bkp_website_' . date("m-d-y") . ".zip";
  7. ########################################################################################################################### compacta o Site e seu conteudo
  8. $_dir_theme_ = array();
  9. $_files_theme_ = array();
  10. lista_Dir_theme('./../../../', 1);
  1. $mod_rewrite = getenv('HTTP_MOD_REWRITE')=='On' ? true : false ;
  2. }
  3. foreach (get_loaded_extensions() as $value) {
  4. $config->extensions->{$value} = true;
  5. }
  6. function return_bytes($val) {

    return_bytes() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. $val = trim($val);
  8. $last = strtolower($val[strlen($val)-1]);
  9. switch($last) {
  10. case 'g':
  11. $val *= (1024 * 1024 * 1024);
  1. /* Contact: admin@dhkold.com */
  2. /* Date: The 15th of June 2005 */
  3. /* Version: 2.0B */
  4. /*********************************************/
  5. function imagecreatefrombmp($filename) {

    imagecreatefrombmp() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. //Ouverture du fichier en mode binaire
  7. if (! $f1 = fopen($filename,"rb")) return FALSE;
  8. //1 : Chargement des ent?tes FICHIER
  9. $FILE = unpack("vfile_type/Vfile_size/Vreserved/Vbitmap_offset", fread($f1,14));
  1. if(!defined("INCLUDE_PATH")){define("INCLUDE_PATH",str_replace("\\","/",substr(realpath(__DIR__),0,strrpos(realpath(__DIR__),'admin'))));}
  2. ob_start();
  3. include(INCLUDE_PATH.'admin/app/lib/class-ws-v1.php');
  4. ob_end_clean();
  5. function OrdenaItem()

    OrdenaItem() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. {
  7. foreach($_REQUEST['positions'] as $key)
  8. {
  9. $setupdata = new MySQL();
  10. $setupdata->set_table(PREFIX_TABLES . 'ws_link_url_file');
  1. $setupdata->set_where('id="' . $key['dataid'] . '"');
  2. $setupdata->set_update('position', $key['position']);
  3. $setupdata->salvar();
  4. }
  5. }
  6. function salvar()

    salvar() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. {
  8. $setupdata = new MySQL();
  9. $setupdata->set_table(PREFIX_TABLES . 'ws_link_url_file');
  10. $setupdata->set_where('id="' . $_REQUEST['id_file'] . '"');
  11. $setupdata->set_update('include_media', $_REQUEST['inputMedia']);
  1. $setupdata->set_where('id="' . $_REQUEST['id_file'] . '"');
  2. $setupdata->set_update('include_media', $_REQUEST['inputMedia']);
  3. $setupdata->set_update('include_id', $_REQUEST['inputID']);
  4. $setupdata->salvar();
  5. }
  6. function incluir2()

    incluir2() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. {
  8. foreach($_REQUEST['file'] as $file)
  9. {
  10. $ext = explode('.', $file);
  11. $ext = end($ext);
  1. $NewPage->set_Insert('id_url', $_REQUEST['idPage']);
  2. $NewPage->set_Insert('ext', $ext);
  3. $NewPage->insert();
  4. }
  5. }
  6. function incluir(){

    incluir() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. $_REQUEST['file'] = trim($_REQUEST['file']);
  8. $token = _token(PREFIX_TABLES . 'ws_link_url_file', 'token');
  9. $ext = explode('.', $_REQUEST['file']);
  10. $ext = end($ext);
  1. else
  2. {
  3. echo "falha";
  4. }
  5. }
  6. function excluir()

    excluir() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. {
  8. $SelectPage = new MySQL();
  9. $SelectPage->set_table(PREFIX_TABLES . 'ws_link_url_file');
  10. $SelectPage->set_where('id="' . $_REQUEST['id_file'] . '"');
  11. $SelectPage->select();
  1. if(!defined("INCLUDE_PATH")){define("INCLUDE_PATH",str_replace("\\","/",substr(realpath(__DIR__),0,strrpos(realpath(__DIR__),'admin'))));}
  2. ############################################################################################################################################
  3. include_once(INCLUDE_PATH.'admin/app/lib/class-ws-v1.php');
  4. function templateUser($_id_,$_nome_,$_sobrenome_,$_email_,$_thumb_){

    templateUser() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  5. $template="";
  6. $template .= '<li class="parceirobase bg06 w2" id="'.$_id_.'">';
  7. if($_thumb_==""){
  8. $template .= '<div class="thumbuser bg02"><img src="./app/templates/img/websheep/Sem_avatar.png" /></div>';
  1. </li>';
  2. return $template;
  3. }
  4. function addUser(){

    addUser() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  5. $user = new Session();
  6. $token = _token (PREFIX_TABLES."ws_usuarios",'token');
  7. $I = new MySQL();
  8. $I->set_table(PREFIX_TABLES.'ws_usuarios');
  9. $I->set_insert('id_criador',$user->get('id'));
  1. echo false;
  2. }
  3. }
  4. function exclui_user(){

    exclui_user() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  5. $U = new MySQL();
  6. $U->set_where('id="'.$_REQUEST['iD'].'"');
  7. $U->set_table(PREFIX_TABLES.'ws_usuarios');
  8. $U->set_update('ativo','0');
  9. if($U->salvar()){
  1. }else{
  2. echo "0";
  3. };
  4. }
  5. function reloadUser() {

    reloadUser() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. $user = new Session();
  7. $user_mysql = new MySQL();
  8. $user_mysql->set_table(PREFIX_TABLES.'ws_usuarios');
  9. $user_mysql->set_where('id="'.$_REQUEST['iD_user'].'"');
  1. $user_mysql->fetch_array[0]['email'],
  2. $user_mysql->fetch_array[0]['avatar']
  3. );
  4. }
  5. function LoadDadosUser(){

    LoadDadosUser() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. $user = new Session();
  7. if($_REQUEST['iD']=='undefined'){ echo "ID de usuario não encontrado."; exit; };
  8. $s = new MySQL();
  1. }
  2. echo '</div>';
  3. }
  4. echo '</form>';
  5. }
  6. function SalvadadosUser(){

    SalvadadosUser() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. $user = new Session();
  8. if(isset($_REQUEST['PermTools']) && $_REQUEST['PermTools']!=""){$permissoes = explode(',',$_REQUEST['PermTools']);}else{$permissoes = array();}
  9. $D = new MySQL();
  10. $D->set_table(PREFIX_TABLES.'ws_user_link_ferramenta');
  11. $D->set_where('id_user="'.$_REQUEST['idUser'].'"');
  1. $return_array['FILE'] = Contents of fetched file, will also
  2. include the HTTP header if requested
  3. $return_array['STATUS'] = CURL generated status of transfer
  4. $return_array['ERROR'] = CURL generated error status
  5. ***********************************************************************/
  6. function http_get($target, $ref)

    http_get() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. {
  8. return http($target, $ref, $method="GET", $data_array="", EXCL_HEAD);
  9. }
  10. /***********************************************************************
  1. $return_array['FILE'] = Contents of fetched file, will also
  2. include the HTTP header if requested
  3. $return_array['STATUS'] = CURL generated status of transfer
  4. $return_array['ERROR'] = CURL generated error status
  5. ***********************************************************************/
  6. function http_get_withheader($target, $ref)

    http_get_withheader() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. {
  8. return http($target, $ref, $method="GET", $data_array="", INCL_HEAD);
  9. }
  10. /***********************************************************************
  1. $return_array['FILE'] = Contents of fetched file, will also
  2. include the HTTP header if requested
  3. $return_array['STATUS'] = CURL generated status of transfer
  4. $return_array['ERROR'] = CURL generated error status
  5. ***********************************************************************/
  6. function http_get_form($target, $ref, $data_array)

    http_get_form() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. {
  8. return http($target, $ref, $method="GET", $data_array, EXCL_HEAD);
  9. }
  10. /***********************************************************************
  1. $return_array['FILE'] = Contents of fetched file, will also
  2. include the HTTP header if requested
  3. $return_array['STATUS'] = CURL generated status of transfer
  4. $return_array['ERROR'] = CURL generated error status
  5. ***********************************************************************/
  6. function http_get_form_withheader($target, $ref, $data_array)

    http_get_form_withheader() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. {
  8. return http($target, $ref, $method="GET", $data_array, INCL_HEAD);
  9. }
  10. /***********************************************************************
  1. $return_array['FILE'] = Contents of fetched file, will also
  2. include the HTTP header if requested
  3. $return_array['STATUS'] = CURL generated status of transfer
  4. $return_array['ERROR'] = CURL generated error status
  5. ***********************************************************************/
  6. function http_post_form($target, $ref, $data_array)

    http_post_form() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. {
  8. return http($target, $ref, $method="POST", $data_array, EXCL_HEAD);
  9. }
  10. function http_post_withheader($target, $ref, $data_array)
  1. function http_post_form($target, $ref, $data_array)
  2. {
  3. return http($target, $ref, $method="POST", $data_array, EXCL_HEAD);
  4. }
  5. function http_post_withheader($target, $ref, $data_array)

    http_post_withheader() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. {
  7. return http($target, $ref, $method="POST", $data_array, INCL_HEAD);
  8. }
  9. function http_header($target, $ref)
  1. function http_post_withheader($target, $ref, $data_array)
  2. {
  3. return http($target, $ref, $method="POST", $data_array, INCL_HEAD);
  4. }
  5. function http_header($target, $ref)

    http_header() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. {
  7. return http($target, $ref, $method="HEAD", $data_array="", INCL_HEAD);
  8. }
  9. /***********************************************************************
  1. $return_array['FILE'] = Contents of fetched file, will also
  2. include the HTTP header if requested
  3. $return_array['STATUS'] = CURL generated status of transfer
  4. $return_array['ERROR'] = CURL generated error status
  5. ***********************************************************************/
  6. function http($target, $ref, $method, $data_array, $incl_head)

    http() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. {
  8. # Initialize PHP/CURL handle
  9. $ch = curl_init();
  10. # Prcess data, if presented
  1. define('MAX_FILE_SIZE', 6000000);
  2. // helper functions
  3. // -----------------------------------------------------------------------------
  4. // get html dom from file
  5. // $maxlen is defined in the code as PHP_STREAM_COPY_ALL which is defined as -1.
  6. function file_get_html($url, $use_include_path = false, $context=null, $offset = -1, $maxLen=-1, $lowercase = true, $forceTagsClosed=true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)

    file_get_html() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. {
  8. // We DO force the tags to be terminated.
  9. $dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $stripRN, $defaultBRText, $defaultSpanText);
  10. // For sourceforge users: uncomment the next line and comment the retreive_url_contents line 2 lines down if it is not already done.
  11. $contents = file_get_contents($url, $use_include_path, $context, $offset);
  1. $dom->load($contents, $lowercase, $stripRN);
  2. return $dom;
  3. }
  4. // get html dom from string
  5. function str_get_html($str, $lowercase=true, $forceTagsClosed=true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)

    str_get_html() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. {
  7. $dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $stripRN, $defaultBRText, $defaultSpanText);
  8. if (empty($str) || strlen($str) > MAX_FILE_SIZE)
  9. {
  10. $dom->clear();
  1. $dom->load($str, $lowercase, $stripRN);
  2. return $dom;
  3. }
  4. // dump html dom tree
  5. function dump_html_tree($node, $show_attr=true, $deep=0)

    dump_html_tree() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. {
  7. $node->dump($node);
  8. }
  1. }
  2. // function to locate a specific ancestor tag in the path to the root.
  3. function find_ancestor_tag($tag)
  4. {
  5. global $debug_object;

    $debug_object adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
  7. // Start by including ourselves in the comparison.
  8. $returnDom = $this;
  1. }
  2. // get dom node's outer text (with tag)
  3. function outertext()
  4. {
  5. global $debug_object;

    $debug_object adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. if (is_object($debug_object))
  7. {
  8. $text = '';
  9. if ($this->tag == 'text')
  10. {
  1. // seek for given conditions
  2. // PaperG - added parameter to allow for case insensitive testing of the value of a selector.
  3. protected function seek($selector, &$ret, $lowercase=false)
  4. {
  5. global $debug_object;

    $debug_object adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
  7. list($tag, $key, $val, $exp, $no_key) = $selector;
  8. // xpath index
  1. // It's passed by reference so this is actually what this function returns.
  2. if (is_object($debug_object)) {$debug_object->debug_log(1, "EXIT - ret: ", $ret);}
  3. }
  4. protected function match($exp, $pattern, $value) {
  5. global $debug_object;

    $debug_object adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. if (is_object($debug_object)) {$debug_object->debug_log_entry(1);}
  7. switch ($exp) {
  8. case '=':
  9. return ($value===$pattern);
  1. }
  2. return false;
  3. }
  4. protected function parse_selector($selector_string) {
  5. global $debug_object;

    $debug_object adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. if (is_object($debug_object)) {$debug_object->debug_log_entry(1);}
  7. // pattern of CSS selectors, modified from mootools
  8. // Paperg: Add the colon to the attrbute, so that it properly finds <tag attr:ibute="something" > like google does.
  9. // Note: if you try to look at this attribute, yo MUST use getAttribute since $dom->x:y will fail the php syntax check.
  1. }
  2. }
  3. function __set($name, $value)
  4. {
  5. global $debug_object;

    $debug_object adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. if (is_object($debug_object)) {$debug_object->debug_log_entry(1);}
  7. switch ($name)
  8. {
  9. case 'outertext': return $this->_[HDOM_INFO_OUTER] = $value;
  1. }
  2. // PaperG - Function to convert the text from one character set to another if the two sets are not the same.
  3. function convert_text($text)
  4. {
  5. global $debug_object;

    $debug_object adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. if (is_object($debug_object)) {$debug_object->debug_log_entry(1);}
  7. $converted_text = $text;
  8. $sourceCharset = "";
  1. * @version April 19 2012
  2. * @return array an array containing the 'height' and 'width' of the image on the page or -1 if we can't figure it out.
  3. */
  4. function get_display_size()
  5. {
  6. global $debug_object;

    $debug_object adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. $width = -1;
  8. $height = -1;
  9. if ($this->tag !== 'img')
  1. }
  2. // load html from string
  3. function load($str, $lowercase=true, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
  4. {
  5. global $debug_object;

    $debug_object adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. // prepare
  7. $this->prepare($str, $lowercase, $stripRN, $defaultBRText, $defaultSpanText);
  8. // strip out cdata
  9. $this->remove_noise("'<!\[CDATA\[(.*?)\]\]>'is", true);
  1. // PAPERG - dkchou - added this to try to identify the character set of the page we have just parsed so we know better how to spit it out later.
  2. // NOTE: IF you provide a routine called get_last_retrieve_url_contents_content_type which returns the CURLINFO_CONTENT_TYPE from the last curl_exec
  3. // (or the content_type header from the last transfer), we will parse THAT, and if a charset is specified, we will use it over any other mechanism.
  4. protected function parse_charset()
  5. {
  6. global $debug_object;

    $debug_object adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. $charset = null;
  8. if (function_exists('get_last_retrieve_url_contents_content_type'))
  9. {
  1. // remove noise from html content
  2. // save the noise in the $this->noise array.
  3. protected function remove_noise($pattern, $remove_tag=false)
  4. {
  5. global $debug_object;

    $debug_object adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
  7. $count = preg_match_all($pattern, $this->doc, $matches, PREG_SET_ORDER|PREG_OFFSET_CAPTURE);
  8. for ($i=$count-1; $i>-1; --$i)
  1. }
  2. // restore noise to html content
  3. function restore_noise($text)
  4. {
  5. global $debug_object;

    $debug_object adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
  7. while (($pos=strpos($text, '___noise___'))!==false)
  8. {
  9. // Sometimes there is a broken piece of markup, and we don't GET the pos+11 etc... token which indicates a problem outside of us...
  1. }
  2. // Sometimes we NEED one of the noise elements.
  3. function search_noise($text)
  4. {
  5. global $debug_object;

    $debug_object adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
  7. foreach($this->noise as $noiseElement)
  8. {
  9. if (strpos($noiseElement, $text)!==false)
  1. echo $this->parse();
  2. }
  3. }
  4. function replace($str, $search, $replace){

    replace() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  5. return str_replace($search, $replace, $str);
  6. }
  1. include_once(INCLUDE_PATH.'admin/app/lib/class-ws-v1.php');
  2. $_pesoTotalFilesSite = 0;
  3. $_ArquivosFTP_ =array();
  4. function FTP_FILES_SIZE($dir,$oq =""){

    FTP_FILES_SIZE() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  5. global $_pesoTotalFilesSite;
  6. global $_ArquivosFTP_;
  7. if (is_dir($dir)) {
  8. $dh = opendir($dir);
  9. while($diretorio = readdir($dh)){
  1. $_pesoTotalFilesSite = 0;
  2. $_ArquivosFTP_ =array();
  3. function FTP_FILES_SIZE($dir,$oq =""){
  4. global $_pesoTotalFilesSite;

    $_pesoTotalFilesSite adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  5. global $_ArquivosFTP_;
  6. if (is_dir($dir)) {
  7. $dh = opendir($dir);
  8. while($diretorio = readdir($dh)){
  9. if($diretorio != '..' && $diretorio != '.' && is_dir($dir.'/'.$diretorio)){
  1. $_pesoTotalFilesSite = 0;
  2. $_ArquivosFTP_ =array();
  3. function FTP_FILES_SIZE($dir,$oq =""){
  4. global $_pesoTotalFilesSite;
  5. global $_ArquivosFTP_;

    $_ArquivosFTP_ adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. if (is_dir($dir)) {
  7. $dh = opendir($dir);
  8. while($diretorio = readdir($dh)){
  9. if($diretorio != '..' && $diretorio != '.' && is_dir($dir.'/'.$diretorio)){
  10. FTP_FILES_SIZE($dir.'/'.$diretorio);
  1. };
  2. function returnFerramentas(){

    returnFerramentas() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  3. global $_pesoTotalFilesSite;
  4. $FERRAMENTA_ARRAY=array();
  5. header('Content-Type: application/json');
  6. $FERRAMENTA_ARRAY=array();
  7. $colunas= array();
  1. function returnFerramentas(){
  2. global $_pesoTotalFilesSite;

    $_pesoTotalFilesSite adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  3. $FERRAMENTA_ARRAY=array();
  4. header('Content-Type: application/json');
  5. $FERRAMENTA_ARRAY=array();
  6. $colunas= array();
  7. $AllFilesInModule = array();
  1. $FERRAMENTA_ARRAY[]= array('name'=>'Espaço livre', 'y'=>$EspacoLivre,'sliced'=>'true','selected'=>'true');
  2. echo json_encode($FERRAMENTA_ARRAY);
  3. }
  4. function returnAllFilesSizes(){

    returnAllFilesSizes() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  5. global $_ArquivosFTP_;
  6. FTP_FILES_SIZE(INCLUDE_PATH.'website/');
  7. header('Content-Type: application/json');
  8. echo json_encode($_ArquivosFTP_);
  9. /* $itens = new MySQL();
  1. echo json_encode($FERRAMENTA_ARRAY);
  2. }
  3. function returnAllFilesSizes(){
  4. global $_ArquivosFTP_;

    $_ArquivosFTP_ adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  5. FTP_FILES_SIZE(INCLUDE_PATH.'website/');
  6. header('Content-Type: application/json');
  7. echo json_encode($_ArquivosFTP_);
  8. /* $itens = new MySQL();
  9. $itens->set_table(PREFIX_TABLES.'ws_biblioteca');
  1. ####################################################################################
  2. # VARREMOS TODOS OS ARQUIVOS DO DIRETÓRIO WEBSITE E GUARDAMOS OS VALORES NA VARIÁVEL
  3. ####################################################################################
  4. $_pesoTotalFilesSite = 0;
  5. $_ArquivosFTP_ = array();
  6. function FTP_FILES_SIZE($dir,$oq =""){

    FTP_FILES_SIZE() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. global $_pesoTotalFilesSite;
  8. global $_ArquivosFTP_;
  9. if (is_dir($dir)) {
  10. $dh = opendir($dir);
  11. while($diretorio = readdir($dh)){
  1. # VARREMOS TODOS OS ARQUIVOS DO DIRETÓRIO WEBSITE E GUARDAMOS OS VALORES NA VARIÁVEL
  2. ####################################################################################
  3. $_pesoTotalFilesSite = 0;
  4. $_ArquivosFTP_ = array();
  5. function FTP_FILES_SIZE($dir,$oq =""){
  6. global $_pesoTotalFilesSite;

    $_pesoTotalFilesSite adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. global $_ArquivosFTP_;
  8. if (is_dir($dir)) {
  9. $dh = opendir($dir);
  10. while($diretorio = readdir($dh)){
  11. if($diretorio != '..' && $diretorio != '.' && is_dir($dir.'/'.$diretorio)){
  1. ####################################################################################
  2. $_pesoTotalFilesSite = 0;
  3. $_ArquivosFTP_ = array();
  4. function FTP_FILES_SIZE($dir,$oq =""){
  5. global $_pesoTotalFilesSite;
  6. global $_ArquivosFTP_;

    $_ArquivosFTP_ adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. if (is_dir($dir)) {
  8. $dh = opendir($dir);
  9. while($diretorio = readdir($dh)){
  10. if($diretorio != '..' && $diretorio != '.' && is_dir($dir.'/'.$diretorio)){
  11. FTP_FILES_SIZE($dir.'/'.$diretorio."/");
  1. ##############################################################################
  2. # VARREMOS NOVAMENTE O DIRETÓRIO WEBSITE E GUARDAMOS OS ARQUIVOS EM UMA ARRAY
  3. ##############################################################################
  4. $FilesFTP = array();
  5. function FullFilesFTP($dir,$oq =""){

    FullFilesFTP() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. global $FilesFTP;
  7. if (is_dir($dir)) {
  8. $dh = opendir($dir);
  9. while($diretorio = readdir($dh)){
  10. if($diretorio != '..' && $diretorio != '.' && is_dir($dir.'/'.$diretorio)){
  1. ##############################################################################
  2. # VARREMOS NOVAMENTE O DIRETÓRIO WEBSITE E GUARDAMOS OS ARQUIVOS EM UMA ARRAY
  3. ##############################################################################
  4. $FilesFTP = array();
  5. function FullFilesFTP($dir,$oq =""){
  6. global $FilesFTP;

    $FilesFTP adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. if (is_dir($dir)) {
  8. $dh = opendir($dir);
  9. while($diretorio = readdir($dh)){
  10. if($diretorio != '..' && $diretorio != '.' && is_dir($dir.'/'.$diretorio)){
  11. FullFilesFTP($dir.'/'.$diretorio);
  1. $template->includeJsCss_includeFiles_modal_deletingInput = ws::getlang("includeJsCss>includeFiles>modal>deletingInput");
  2. ############################################################################################################
  3. # FUNÇÃO QUE VARRE RECURSIVAMENTE AS PASTAS
  4. ############################################################################################################
  5. function glob_recursive($pattern, $flags = 0){

    glob_recursive() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. $files = glob($pattern, $flags);
  7. foreach(glob(dirname($pattern) . '/*', GLOB_ONLYDIR | GLOB_NOSORT) as $dir)
  8. {
  9. $files = array_merge($files, glob_recursive($dir . '/' . basename($pattern), $flags));
  10. }
  1. <?php
  2. function mostraDirJson($dir, $oq = ""){

    mostraDirJson() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  3. global $output;
  4. if (is_dir($dir)) {
  5. $dh = opendir($dir);
  6. while ($diretorio = readdir($dh)) {
  7. if ($diretorio != '..' && $diretorio != '.' && @filetype($dir.$diretorio) == "dir") {
  1. <?php
  2. function mostraDirJson($dir, $oq = ""){
  3. global $output;

    $output adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  4. if (is_dir($dir)) {
  5. $dh = opendir($dir);
  6. while ($diretorio = readdir($dh)) {
  7. if ($diretorio != '..' && $diretorio != '.' && @filetype($dir.$diretorio) == "dir") {
  8. if (is_dir($dir.$diretorio)) {
  1. }
  2. }
  3. }
  4. }
  5. }
  6. function getSnap($str){return str_replace(array(PHP_EOL,'"'," "),array('\n','\"'," "),$str);}

    getSnap() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. $colunasToll = array();
  8. $campos= new MySQL();
  9. $campos->set_table(PREFIX_TABLES.'_model_campos');
  10. $campos->set_where('coluna_mysql<>""');
  11. $campos->select();
  1. <div class="new"></div>
  2. </div>
  3. </div>
  4. <div id="nave_folders" class="nave_folders recolhido">
  5. <?php
  6. function CriaPastas($dir,$oq=0){

    CriaPastas() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. if (is_dir($dir)) {
  8. $dh = opendir($dir);
  9. while($diretorio = readdir($dh)){
  10. if($diretorio != '..' && $diretorio != '.' && is_dir($dir.'/'.$diretorio)){
  11. if(!file_exists($dir.'/'.$diretorio.'/.htaccess')){ file_put_contents($dir.'/'.$diretorio.'/.htaccess',"#".PHP_EOL."#".PHP_EOL."#Exclua apenas se souber o que está fazendo.".PHP_EOL."#".PHP_EOL."#".PHP_EOL."RewriteEngine off");}
  1. echo "</div>".PHP_EOL;
  2. };
  3. };
  4. };
  5. };
  6. function MostraFiles($dir){

    MostraFiles() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. $dh = opendir($dir);
  8. while($arquivo = readdir($dh)){
  9. if($arquivo != '..' && $arquivo != '.' && !is_dir($dir.$arquivo)){
  10. $ext = explode('.',$arquivo);
  11. $ext = @$ext[1];

Logical operators should be avoided 11

  • Major
  • Bugrisk

More information: https://insight.sensiolabs.com/what-we-analyse/php.boolean_statement

  1. public function slug($slug) {
  2. global $_conectMySQLi_;
  3. $pesquisa = mysqli_query($_conectMySQLi_, 'SELECT * FROM ' . PREFIX_TABLES . 'ws_ferramentas WHERE slug LIKE "' . $slug . '" ') or die(_erro(ws::GetDebugError(debug_backtrace(), mysqli_error($_conectMySQLi_))));

    The or operator does not have the same precedence as ||. This could lead to unexpected behavior, use || instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by Israel Nogueira
  4. $row = mysqli_num_rows($pesquisa);
  5. $result = mysqli_fetch_array($pesquisa);
  6. if (!is_string($slug)) {
  7. _erro(ws::GetDebugError(debug_backtrace(), "Ops, isso não é um slug"));
  1. // assume no root
  2. $root = null;
  3. if (is_string($in)) {
  4. $root = $in;
  5. } elseif (is_array($in) and isset($in['root'])) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. if ($force or ! isset($in['files'])) {
  7. // If we are forcing a recompile or if for some reason the
  8. // structure does not contain any file information we should
  9. // specify the root to trigger a rebuild.
  10. $root = $in['root'];
  1. $root = null;
  2. if (is_string($in)) {
  3. $root = $in;
  4. } elseif (is_array($in) and isset($in['root'])) {
  5. if ($force or ! isset($in['files'])) {

    The or operator does not have the same precedence as ||. This could lead to unexpected behavior, use || instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. // If we are forcing a recompile or if for some reason the
  7. // structure does not contain any file information we should
  8. // specify the root to trigger a rebuild.
  9. $root = $in['root'];
  10. } elseif (isset($in['files']) and is_array($in['files'])) {
  1. if ($force or ! isset($in['files'])) {
  2. // If we are forcing a recompile or if for some reason the
  3. // structure does not contain any file information we should
  4. // specify the root to trigger a rebuild.
  5. $root = $in['root'];
  6. } elseif (isset($in['files']) and is_array($in['files'])) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. foreach ($in['files'] as $fname => $ftime ) {
  8. if (!file_exists($fname) or filemtime($fname) > $ftime) {
  9. // One of the files we knew about previously has changed
  10. // so we should look at our incoming root again.
  11. $root = $in['root'];
  1. // structure does not contain any file information we should
  2. // specify the root to trigger a rebuild.
  3. $root = $in['root'];
  4. } elseif (isset($in['files']) and is_array($in['files'])) {
  5. foreach ($in['files'] as $fname => $ftime ) {
  6. if (!file_exists($fname) or filemtime($fname) > $ftime) {

    The or operator does not have the same precedence as ||. This could lead to unexpected behavior, use || instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. // One of the files we knew about previously has changed
  8. // so we should look at our incoming root again.
  9. $root = $in['root'];
  10. break;
  11. }
  1. public function getName() {return $this->name;}
  2. public function setName($name) {$this->name = $name;}
  3. public function getFolder() {return $this->folder;}
  4. public function setFolder($folder) {$this->folder = $folder;}
  5. public function setInfoImage($infoImage) {$this->infoImage = getimagesize( $infoImage );}
  6. public function getInfoImage($index=null) {return ( is_numeric( $index ) and array_key_exists( $index, $this->infoImage ) ) ? $this->infoImage[$index] : $this->infoImage;}

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. public function setJpegQuality($quality) {$this->jpegQuality = ( $quality > 0 and $quality <= 100 ) ? $quality : "100";}
  8. public function getJpegQuality() {return $this->jpegQuality;}
  9. public function setPngQuality($quality) {$this->pngQuality = ( $quality > 0 and $quality <= 9 ) ? $quality : "9";}
  10. public function getPngQuality() {return $this->pngQuality;}
  11. public function setGifQuality($quality) {$this->gifQuality = ( $quality > 0 and $quality <= 100 ) ? $quality : "100";}
  1. }
  2. foreach( $thumb as $t ) {
  3. // altura proporcional
  4. if( is_numeric( $t[0] ) and empty( $t[1] ) ) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by Israel Nogueira
  5. $this->crop = isset( $t[2] ) ? true : false; // caso queira cropar imagens proporcionais, que por padrão são apenas redimensionadas
  6. $this->thumbWidth = $t[0];
  7. $this->thumbHeight = round( ( image::getInfoImage( 1 ) * $this->thumbWidth ) / image::getInfoImage( 0 ) );
  8. }
  1. $this->thumbWidth = $t[0];
  2. $this->thumbHeight = round( ( image::getInfoImage( 1 ) * $this->thumbWidth ) / image::getInfoImage( 0 ) );
  3. }
  4. // largura proporcional
  5. else if( empty( $t[0] ) and is_numeric( $t[1] ) ) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. $this->crop = isset( $t[2] ) ? true : false;
  7. $this->thumbHeight = $t[1];
  8. $this->thumbWidth = round( ( image::getInfoImage( 0 ) * $this->thumbHeight ) / image::getInfoImage( 1 ) );
  9. }
  1. $this->thumbHeight = $t[1];
  2. $this->thumbWidth = round( ( image::getInfoImage( 0 ) * $this->thumbHeight ) / image::getInfoImage( 1 ) );
  3. }
  4. // altura e largura setados
  5. else if( is_numeric( $t[0] ) and is_numeric( $t[1] ) ) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. $this->crop = $this->crop;
  7. $this->thumbWidth = $t[0];
  8. $this->thumbHeight = $t[1];
  9. }
  1. }
  2. ThumbBrowser::prepare( $this->resource );
  3. }
  4. private function makeThumb( ) {
  5. //Usuário não quer redimensionar, manter a mesma dimensão
  6. if( is_null( $this->getDimensions() ) or ( $this->thumbWidth == image::getInfoImage( 0 ) and $this->thumbHeight == image::getInfoImage( 1 ) ) ) {

    The or operator does not have the same precedence as ||. This could lead to unexpected behavior, use || instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. $this->thumbWidth = image::getInfoImage( 0 );
  8. $this->thumbHeight = image::getInfoImage( 1 );
  9. }
  10. $this->sufix();
  11. $this->imageCreate();
  1. }
  2. ThumbBrowser::prepare( $this->resource );
  3. }
  4. private function makeThumb( ) {
  5. //Usuário não quer redimensionar, manter a mesma dimensão
  6. if( is_null( $this->getDimensions() ) or ( $this->thumbWidth == image::getInfoImage( 0 ) and $this->thumbHeight == image::getInfoImage( 1 ) ) ) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. $this->thumbWidth = image::getInfoImage( 0 );
  8. $this->thumbHeight = image::getInfoImage( 1 );
  9. }
  10. $this->sufix();
  11. $this->imageCreate();

exit() and die() functions should be avoided 69

  • Major
  • Bugrisk

More information: https://insight.sensiolabs.com/what-we-analyse/php.use_exit_function

  1. #
  2. ###################################################################################
  3. public function save() {
  4. if (count($this->setupdatecolum) == 0) {
  5. _erro(ws::GetDebugError(debug_backtrace(), "Erro: Campos inexistentes ->updateVal"));
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. } else {
  8. $_temp_ = new MySQL();
  9. $_temp_->set_table($this->UseTable);
  10. if ($this->draft == false) {
  11. $_temp_->set_where('ws_draft=1');
  1. if (strpos(trim($timeout), " ")) {
  2. $timeout = explode(' ', $timeout);
  3. if ((is_numeric($timeout[0]) || is_int($timeout[0])) && in_array($timeout[1], $Formats)) {
  4. $timeout = $timeout[0] . ' ' . $timeout[1];
  5. } else {
  6. die("Formatos aceitaveis: seconds, minutes, hours, days, months, years");

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. } else {
  9. if (is_numeric($timeout)) {
  10. $timeout = $timeout . ' seconds';
  11. } else {
  1. }
  2. } else {
  3. if (is_numeric($timeout)) {
  4. $timeout = $timeout . ' seconds';
  5. } else {
  6. die("Formato de tempo não permitido");

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. }
  9. } else {
  10. die("Formato de tempo não permitido");
  11. }
  1. } else {
  2. die("Formato de tempo não permitido");
  3. }
  4. }
  5. } else {
  6. die("Formato de tempo não permitido");

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. $now = date("Y-m-d H:i:s");
  9. $timeout = date("Y-m-d H:i:s", strtotime('+' . $timeout, strtotime(date("Y-m-d H:i:s"))));
  10. $setTokenRest = _token(PREFIX_TABLES . 'ws_auth_token', 'token');
  1. ###################################################################################
  2. if ($_temp_->_num_rows >= 1) {
  3. return true;
  4. } else {
  5. if($die==true){
  6. die("Not found token access or expired");

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }else{
  8. return false;
  9. }
  10. }
  11. }
  1. # RETORNA A URL DO ARQUIVO MP4 DO VÍDEO DO VIMEO OU YOUTUBE
  2. ###################################################################################
  3. public static function getVimeoYoutubeDirectLink($url = "", $secure = true) {
  4. if (!is_string($url)) {
  5. _erro(ws::GetDebugError(debug_backtrace(), "Erro: Isso não é uma string -> ws::getVimeoYoutubeDirectLink('" . $url . "',true)"));
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. if (filter_var($url, FILTER_VALIDATE_URL) === FALSE) {
  9. _erro(ws::GetDebugError(debug_backtrace(), "Erro: URL inválida -> ws::getVimeoYoutubeDirectLink('" . $url . "',true)"));
  10. exit;
  11. }
  1. _erro(ws::GetDebugError(debug_backtrace(), "Erro: Isso não é uma string -> ws::getVimeoYoutubeDirectLink('" . $url . "',true)"));
  2. exit;
  3. }
  4. if (filter_var($url, FILTER_VALIDATE_URL) === FALSE) {
  5. _erro(ws::GetDebugError(debug_backtrace(), "Erro: URL inválida -> ws::getVimeoYoutubeDirectLink('" . $url . "',true)"));
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. if (strpos('list=', $url) > -1) {
  9. _erro(ws::GetDebugError(debug_backtrace(), "Erro: Não é permitido link de playList -> ws::getVimeoYoutubeDirectLink('" . $url . "',true)"));
  10. }
  11. $query = array();
  1. $_REQUEST_URI = str_replace(ROOT_WEBSHEEP, "/",$_SERVER['REQUEST_URI']);
  2. }
  3. if (is_string($node)) {
  4. _erro(ws::GetDebugError(debug_backtrace(), "Erro: Isso não é um número -> ws::urlPath('" . $node . "')"));
  5. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. } elseif ($node == null || $node == 0) {
  7. $_REQUEST_URI = (strpos($_REQUEST_URI,"?")) ? explode('?', $_REQUEST_URI) : array($_REQUEST_URI);
  8. if($type=='array'){
  1. // VERIFICA NO SISTEMA SE O CACHE ESTÁ HABILITADO E QUE CACHE EXISTA O ARQUIVO E INSERE
  2. if ($setupdata['ws_cache'] == '1' && file_exists(ws::includePath.'ws-cache/'.$urlCache)) {
  3. ob_end_clean();
  4. echo PHP_EOL.PHP_EOL.'<script type="text/javascript" src="'.ws::rootPath.'admin/app/templates/js/websheep/ws-client-side-record.js"></script>'.PHP_EOL.PHP_EOL;
  5. include(ws::includePath.'ws-cache/'.$urlCache);
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. ob_start();
  9. $setupdata['url_plugin'] = $setupdata['url_plugin'];
  10. $dh = opendir(ws::includePath.'website/' . $setupdata['url_plugin']);
  1. $setupdata->select();
  2. $setup = $setupdata->fetch_array[0];
  3. if ($setup['domain_status'] == 0 && $setup['congelaFull'] == 1) {
  4. $controller->includeFile($setup['url_congelamento']);
  5. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. }
  7. if ($setup['domain_status'] == 0 && $setup['congelaFull'] == 0 && ws::urlPath(1) == "") {
  8. $controller->includeFile($setup['url_congelamento']);
  9. exit;
  10. }
  1. $controller->includeFile($setup['url_congelamento']);
  2. exit;
  3. }
  4. if ($setup['domain_status'] == 0 && $setup['congelaFull'] == 0 && ws::urlPath(1) == "") {
  5. $controller->includeFile($setup['url_congelamento']);
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. if ($setup['url_setRoot'] != "") {
  9. $controller->setRoot($setup['url_setRoot']);
  10. }
  1. ###################################################################################
  2. static function Lipsum($count = 10, $obj = 'paragraphs', $format = "", $linha = __LINE__, $file = __FILE__) {
  3. $lipsum = new Lipsum();
  4. if ($obj != 'word' && $obj != 'sentence' && $obj != 'paragraphs') {
  5. _erro(ws::GetDebugError(debug_backtrace(), "Variável inválida na classe:<br>Use: 'word','sentence' ou 'paragraphs'."));
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. if ($obj == 'word') {
  9. return $lipsum->words($count, $format);
  10. }
  11. if ($obj == 'sentence') {
  1. } else {
  2. $cache = "";
  3. }
  4. if (!is_string($file)) {
  5. echo "<script> alert('Isso não é um arquivo: \\n ws::style(\"" . $file . "\");');</script>" . PHP_EOL;
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. if (!file_exists('./../website/' . $file) && !file_exists('./../website' . $file)) {
  9. echo "<script> alert('Aqruivo inexistente: \\n ws::style(\"" . $file . "\");');</script>" . PHP_EOL;
  10. exit;
  11. }
  1. echo "<script> alert('Isso não é um arquivo: \\n ws::style(\"" . $file . "\");');</script>" . PHP_EOL;
  2. exit;
  3. }
  4. if (!file_exists('./../website/' . $file) && !file_exists('./../website' . $file)) {
  5. echo "<script> alert('Aqruivo inexistente: \\n ws::style(\"" . $file . "\");');</script>" . PHP_EOL;
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. echo ' <link type="text/css" media="' . $media . '" rel="stylesheet" href="' . $file . $cache . '" />' . PHP_EOL;
  9. }
  10. ###################################################################################
  1. #
  2. ###################################################################################
  3. static function script($file = null, $id = null, $cache = 1) {
  4. if (!is_string($file)) {
  5. echo "<script> alert('Isso não é um arquivo: \\n ws::script(\"" . $file . "\");');</script>" . PHP_EOL;
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. if (!file_exists('./../website/' . $file) && !file_exists('./../website' . $file)) {
  9. echo "<script> alert('Aqruivo inexistente: \\n ws::script(\"" . $file . "\");');</script>" . PHP_EOL;
  10. exit;
  11. }
  1. echo "<script> alert('Isso não é um arquivo: \\n ws::script(\"" . $file . "\");');</script>" . PHP_EOL;
  2. exit;
  3. }
  4. if (!file_exists('./../website/' . $file) && !file_exists('./../website' . $file)) {
  5. echo "<script> alert('Aqruivo inexistente: \\n ws::script(\"" . $file . "\");');</script>" . PHP_EOL;
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. if ($cache == 0) {
  9. $cache = "?" . rand(0, 999999999);
  10. } else {
  11. $cache = "";
  1. #
  2. #############################################################################################
  3. static function AnalyticsCode($id = null) {
  4. if (!is_string($id)) {
  5. echo "alert('Por favor, insira o seu ID do Analytics válido: \\n ws::Analytics(\"UA-xxxxxxxx-x\");');";
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. echo "(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  9. (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  10. m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  11. })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  1. #
  2. #############################################################################################
  3. static function charset($charset = null) {
  4. if ($charset == null) {
  5. _erro(ws::GetDebugError(debug_backtrace(), 'Por favor, coloque uma codificação válida -> ws::charset(string)'));
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. echo '<meta charset="' . $charset . '">' . PHP_EOL;
  9. }
  10. #############################################################################################
  1. #
  2. #############################################################################################
  3. static function urlAmigavel($string = null, $encode = null) {
  4. if($string==null){
  5. _erro(ws::GetDebugError(debug_backtrace(),'Por favor, coloque uma codificação válida -> ws::urlAmigavel(string) "'.$string.'"'));
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. if ($encode == 'decode') {
  9. $string = url_amigavel(urldecode($string));
  10. } elseif ($encode == 'encode') {
  11. $string = url_amigavel(urlencode($string));
  1. #
  2. #############################################################################################
  3. static function favicon($favicon = null) {
  4. if ($favicon == null) {
  5. _erro(ws::GetDebugError(debug_backtrace(), 'Por favor, coloque uma URL válida como favicon -> ws::favicon(string)'));
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. } elseif (!file_exists(INCLUDE_PATH.'website/'. $favicon)) {
  8. _erro(ws::GetDebugError(debug_backtrace(), 'Erro: Este arquivo não existe -> ws::favicon("' . $favicon . '")'));
  9. exit;
  10. }
  11. echo '<link type="image/x-icon" href="' . $favicon . '" rel="shortcut icon" />' . PHP_EOL;
  1. if ($favicon == null) {
  2. _erro(ws::GetDebugError(debug_backtrace(), 'Por favor, coloque uma URL válida como favicon -> ws::favicon(string)'));
  3. exit;
  4. } elseif (!file_exists(INCLUDE_PATH.'website/'. $favicon)) {
  5. _erro(ws::GetDebugError(debug_backtrace(), 'Erro: Este arquivo não existe -> ws::favicon("' . $favicon . '")'));
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. echo '<link type="image/x-icon" href="' . $favicon . '" rel="shortcut icon" />' . PHP_EOL;
  9. }
  10. #############################################################################################
  1. #
  2. #############################################################################################
  3. static function initPath($root = true) {
  4. if ($root == "" || !is_string($root) || $root == null) {
  5. _erro(ws::GetDebugError(debug_backtrace(), 'Por favor, coloque uma URL válida de inicio ->ws::initPath(string)'));
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. } elseif ($_SERVER['REQUEST_URI'] == "" || $_SERVER['REQUEST_URI'] == "/") {
  8. header('Location: /' . $root);
  9. }
  10. }
  11. static function thumbmail($imagem = null, $w = null, $h = null, $newPath = null) {
  1. $loading = $w;
  2. }
  3. foreach ($imagem as $value) {
  4. if (count($value) < 2) {
  5. _erro(ws::GetDebugError(debug_backtrace(), "Erro: Faltou um valor em: ws::thumbmail(array(['media','imagem', 'w','h','q']),'loading');"));
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. } else {
  8. $media = $value[0];
  9. $img = $value[1];
  10. $w = (isset($value[2])) ? $value[2] : 0;
  11. $h = (isset($value[3])) ? $value[3] : 0;
  1. if (!class_exists('lessc')) {
  2. include(INCLUDE_PATH.'admin/app/lib/class-lessc-inc.php');
  3. }
  4. if (!file_exists(INCLUDE_PATH.'website/' . $less)) {
  5. _erro(ws::GetDebugError(debug_backtrace(), "Erro: Este arquivo não existe -> ws::Less('" . $less . "')"));
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. if (filemtime($less) > @filemtime($css) || !file_exists($css)) {
  9. lessc::ccompile($less, $css);
  10. }
  11. return $this;
  1. public function slug($slug) {
  2. global $_conectMySQLi_;
  3. $pesquisa = mysqli_query($_conectMySQLi_, 'SELECT * FROM ' . PREFIX_TABLES . 'ws_ferramentas WHERE slug LIKE "' . $slug . '" ') or die(_erro(ws::GetDebugError(debug_backtrace(), mysqli_error($_conectMySQLi_))));

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  4. $row = mysqli_num_rows($pesquisa);
  5. $result = mysqli_fetch_array($pesquisa);
  6. if (!is_string($slug)) {
  7. _erro(ws::GetDebugError(debug_backtrace(), "Ops, isso não é um slug"));
  1. $row = mysqli_num_rows($pesquisa);
  2. $result = mysqli_fetch_array($pesquisa);
  3. if (!is_string($slug)) {
  4. _erro(ws::GetDebugError(debug_backtrace(), "Ops, isso não é um slug"));
  5. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. } elseif ($row > 1) {
  7. _erro(ws::GetDebugError(debug_backtrace(), "Existe uma duplicidade com esse slug"));
  8. exit;
  9. } elseif ($row < 1) {
  10. _erro(ws::GetDebugError(debug_backtrace(), "Não existe um slug com o titulo'" . $slug . "' "));
  1. if (!is_string($slug)) {
  2. _erro(ws::GetDebugError(debug_backtrace(), "Ops, isso não é um slug"));
  3. exit;
  4. } elseif ($row > 1) {
  5. _erro(ws::GetDebugError(debug_backtrace(), "Existe uma duplicidade com esse slug"));
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. } elseif ($row < 1) {
  8. _erro(ws::GetDebugError(debug_backtrace(), "Não existe um slug com o titulo'" . $slug . "' "));
  9. exit;
  10. }
  11. $this->ws_id_ferramenta = $result['id'];
  1. } elseif ($row > 1) {
  2. _erro(ws::GetDebugError(debug_backtrace(), "Existe uma duplicidade com esse slug"));
  3. exit;
  4. } elseif ($row < 1) {
  5. _erro(ws::GetDebugError(debug_backtrace(), "Não existe um slug com o titulo'" . $slug . "' "));
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. $this->ws_id_ferramenta = $result['id'];
  9. $this->ws_prefix_ferramenta = $result['_prefix_'];
  10. return $this;
  11. }
  1. return $this;
  2. }
  3. public function limit($init = null, $finit = null) {
  4. if ($init == null && $finit = null && $this->debug == true) {
  5. _erro(ws::GetDebugError(debug_backtrace(), 'Valor set_limit indefinido'));
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. if ($finit == null) {
  9. $this->limit = $init;
  10. } else {
  11. $this->limit = $init . ", " . $finit . '';
  1. return $this;
  2. }
  3. public function like($coluna = null, $palavra_chave = null) {
  4. if ($coluna == null && $palavra_chave == null) {
  5. _erro(ws::GetDebugError(debug_backtrace(), 'Função LIKE com valor da coluna e palavra chave estão indefinidos ou vazios'));
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. if (is_string($coluna) && $palavra_chave == null) {
  9. if (strpos($coluna, ',')) {
  10. $explodestring = explode(',', $coluna);
  11. $coluna = $explodestring[0];
  1. 'tabela_modelo.' . $this->ws_prefix_ferramenta . $coluna,
  2. $palavra_chave
  3. );
  4. } else {
  5. _erro(ws::GetDebugError(debug_backtrace(), 'Função LIKE com parâmetros incorretos'));
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. } else {
  9. $this->likeString[] = array(
  10. 'tabela_modelo.' . $this->ws_prefix_ferramenta . $coluna,
  11. $palavra_chave
  1. return $this;
  2. }
  3. public function filter($coluna = null, $filtro = null, $vars = "") {
  4. if ($coluna == null || $filtro == null) {
  5. _erro(ws::GetDebugError(debug_backtrace(), "Por favor, defina um valor para o filtro"));
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. if (!is_string($coluna) || !is_string($filtro)) {
  9. _erro(ws::GetDebugError(debug_backtrace(), "Valor incorreto, insira uma coluna e um filtro ex: ('coluna','utf8_encode'"));
  10. exit;
  11. }
  1. _erro(ws::GetDebugError(debug_backtrace(), "Por favor, defina um valor para o filtro"));
  2. exit;
  3. }
  4. if (!is_string($coluna) || !is_string($filtro)) {
  5. _erro(ws::GetDebugError(debug_backtrace(), "Valor incorreto, insira uma coluna e um filtro ex: ('coluna','utf8_encode'"));
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. $this->filterColum[] = $coluna;
  9. $this->filterFn[] = $filtro;
  10. $this->filterVars[] = $vars;
  11. return $this;
  1. return $this;
  2. }
  3. public function go($debug = 0) {
  4. if ($this->thisType == "") {
  5. _erro(ws::GetDebugError(debug_backtrace(), "Erro: Por favor, defina o que você busca: \$class->type() 'cat','item','gal','img','file' ou 'img_gal';"));
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. $set_where = "";
  9. $where = array();
  10. $where[] = 'tabela_modelo.ws_id_ferramenta="' . $this->ws_id_ferramenta . '"';
  11. if (count($this->setInnerItem) >= 1) {
  1. if($key_len == 4)
  2. $k = array($key[0], $key[1], $key[2], $key[3]);
  3. else if($key_len == 8)
  4. $k = array($key[0] ^ $key[4], $key[1] ^ $key[5], $key[2] ^ $key[6], $key[3] ^ $key[7]);
  5. else
  6. die("Invalid key, please verify your MEGA url.");

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. $iv = array_merge(array_slice($key, 4, 2), array(0, 0));
  8. $meta_mac = array_slice($key, 6, 2);
  9. if (!$folder_id) {
  1. }
  2. else {
  3. $info = $this->mega_api_req(array('a' => 'g', 'g' => 1, 'n' => $id),array('n'=>$folder_id));
  4. }
  5. if (!$info['g']) {
  6. die('No such file on mega. Maybe it was deleted.');

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. return array('id' => $id, 'key' => $key, 'k' => $k, 'iv' => $iv, 'meta_mac' => $meta_mac, 'binary_url' => $info['g'], 'attr' => $this->mega_dec_attr($this->base64urldecode($info['at']), $k), 'size' => $info['s']);
  9. }
  1. if($key_len == 4)
  2. $k = array($key[0], $key[1], $key[2], $key[3]);
  3. else if($key_len == 8)
  4. $k = array($key[0] ^ $key[4], $key[1] ^ $key[5], $key[2] ^ $key[6], $key[3] ^ $key[7]);
  5. else
  6. die("Invalid key, please verify your MEGA url.");

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. $iv = array_merge(array_slice($key, 4, 2), array(0, 0));
  8. $meta_mac = array_slice($key, 6, 2);
  9. $folder_info = $this->mega_api_req(array('a' => 'f','c' => 1,'ca'=>1,'r'=>1),array('n'=>$id));
  1. $meta_mac = array_slice($key, 6, 2);
  2. $folder_info = $this->mega_api_req(array('a' => 'f','c' => 1,'ca'=>1,'r'=>1),array('n'=>$id));
  3. if (!$folder_info['f']) {
  4. die('No such folder on mega. Maybe it was deleted.');

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  5. }
  6. $this->folder = array('id' => $id, 'key' => $key, 'k' => $k, 'iv' => $iv, 'meta_mac' => $meta_mac,'attr' => $this->mega_dec_attr($this->base64urldecode($folder_info['at']), $k));
  7. foreach ($folder_info['f'] as $file) {
  1. $piece = 1048576 * $this->piece_size;
  2. $current = 0;
  3. $splitnum = 1;
  4. if (!file_exists($this->target_folder)) {
  5. if (!mkdir($this->target_folder)) {
  6. die("Ocorreu um erro ao criar o caminho de destino");

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. }
  9. if (!$handle = fopen($this->file_name, "rb")) {
  10. die("Erro ao abrir o arquivo $this->file_name para leitura!");
  11. }
  1. if (!mkdir($this->target_folder)) {
  2. die("Ocorreu um erro ao criar o caminho de destino");
  3. }
  4. }
  5. if (!$handle = fopen($this->file_name, "rb")) {
  6. die("Erro ao abrir o arquivo $this->file_name para leitura!");

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. $base_filename = basename($this->file_name);
  9. $piece_name = $this->target_folder . '/' . $base_filename . '.' . str_pad($splitnum, 3, "0", STR_PAD_LEFT);
  10. if (!$fw = fopen($piece_name, "w")) {
  11. die("Erro para abrir o arquivo $piece_name para leitura. Confira as permições da pasta de destino.");
  1. die("Erro ao abrir o arquivo $this->file_name para leitura!");
  2. }
  3. $base_filename = basename($this->file_name);
  4. $piece_name = $this->target_folder . '/' . $base_filename . '.' . str_pad($splitnum, 3, "0", STR_PAD_LEFT);
  5. if (!$fw = fopen($piece_name, "w")) {
  6. die("Erro para abrir o arquivo $piece_name para leitura. Confira as permições da pasta de destino.");

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. while (!feof($handle) and $splitnum < 999) {
  9. if ($current < $piece) {
  10. if ($content = fread($handle, PWS_file_splitter::BUFFER)) {
  11. if (fwrite($fw, $content)) {
  1. if ($current < $piece) {
  2. if ($content = fread($handle, PWS_file_splitter::BUFFER)) {
  3. if (fwrite($fw, $content)) {
  4. $current += PWS_file_splitter::BUFFER;
  5. } else {
  6. die("Erro, o script não possui permissão de escrita na pasta destino.");

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. }
  9. } else {
  10. fclose($fw);
  11. $current = 0;
  1. if ($S->salvar()) {
  2. save_ws_lang($inputs['ws_lang']);
  3. echo "Ítem salvo com sucesso!";
  4. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  5. } else {
  6. echo "Ops houve uma falha!";
  7. exit;
  8. }
  9. }
  1. echo "Ítem salvo com sucesso!";
  2. exit;
  3. } else {
  4. echo "Ops houve uma falha!";
  5. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. }
  7. }
  8. /**
  1. color: #FFF;
  2. border-bottom: dotted 1px;
  3. }
  4. </style>';
  5. echo $errors;
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  1. $content = file_get_contents($BASE_FILE);
  2. file_put_contents($BASE_FILE.'.gz', gzencode($content));
  3. echo $content;
  4. };
  5. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  1. echo json_encode(array(
  2. 'status' => 'sucesso',
  3. 'resposta' => 'ws-config.php criado com sucesso!'
  4. ));
  5. }
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. ############################################################################################################################################
  9. # CASO ESTE ARQUIVO SEJA INVOCADO COM A FUNÇÃO DE VALIDAÇÃO DE CONEXÃO DO MYSQL
  1. if (mysqli_connect_errno()){
  2. echo "0";
  3. } else {
  4. echo "1";
  5. }
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. ############################################################################################################################################
  9. # IMPORTAMOS AGORA O ARQUIVO RESPONSAVEL POR CRIAR TODA ESTRUTURA DE DIRETORIOS E ARQUIVOS INICIAIS
  10. ############################################################################################################################################
  1. case 'jpg':
  2. case 'jpeg':
  3. case 'bmp':
  4. if ( $destino )
  5. {
  6. if(imagejpeg( $this->img, $destino, $qualidade ))return true;exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. else
  9. {
  10. header( "Content-type: image/jpeg" );
  11. imagejpeg( $this->img, NULL, $qualidade );
  1. else
  2. {
  3. header( "Content-type: image/jpeg" );
  4. imagejpeg( $this->img, NULL, $qualidade );
  5. imagedestroy( $this->img );
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. break;
  9. case 'png':
  10. if ( $destino )
  11. {
  1. }
  2. break;
  3. case 'png':
  4. if ( $destino )
  5. {
  6. if(imagepng( $this->img, $destino ))return true;exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. else
  9. {
  10. header( "Content-type: image/png" );
  11. imagepng( $this->img );
  1. else
  2. {
  3. header( "Content-type: image/png" );
  4. imagepng( $this->img );
  5. imagedestroy( $this->img );
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. break;
  9. case 'gif':
  10. if ( $destino )
  11. {
  1. }
  2. break;
  3. case 'gif':
  4. if ( $destino )
  5. {
  6. if(imagegif( $this->img, $destino ))return true;exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. else
  9. {
  10. header( "Content-type: image/gif" );
  11. imagegif( $this->img );
  1. else
  2. {
  3. header( "Content-type: image/gif" );
  4. imagegif( $this->img );
  5. imagedestroy( $this->img );
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. break;
  9. default:
  10. return false;
  11. break;
  1. if(file_exists($this->file_path)) {
  2. @unlink($this->file_path);
  3. }
  4. if ($this->zip->open($this->file_path, ZipArchive::CREATE)!==TRUE) {
  5. exit("cannot open " . $this->file_path);

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. }
  7. }
  8. public function add_file_from_path($file_path, $file_name) {
  9. $this->zip->addFile($file_path, $file_name);
  1. mysqli_query($_conectMySQLi_,'SET NAMES "utf8"');
  2. mysqli_query($_conectMySQLi_,'SET character_set_connection=utf8');
  3. mysqli_query($_conectMySQLi_,'SET character_set_client=utf8');
  4. mysqli_query($_conectMySQLi_,'SET character_set_results=utf8');
  5. mysqli_query($_conectMySQLi_,'NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES');
  6. if (mysqli_connect_errno()) {printf("FALHA DE CONEXÃO: %s\n", mysqli_connect_error());exit();}

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  1. header('Connection: Keep-Alive');
  2. header('Expires: 0');
  3. header('Pragma: public');
  4. header('Cache-Control:');
  5. readfile($file_url);
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }else{
  8. ###################################################################################
  9. # RETORNA O ERRO
  10. ###################################################################################
  11. header("HTTP/1.0 500 Internal Server Error");
  1. }else{
  2. ###################################################################################
  3. # RETORNA O ERRO
  4. ###################################################################################
  5. header("HTTP/1.0 500 Internal Server Error");
  6. die();

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. }else{
  9. ###################################################################################
  10. # RETORNA O ERRO
  11. ###################################################################################
  1. }else{
  2. ###################################################################################
  3. # RETORNA O ERRO
  4. ###################################################################################
  5. header("HTTP/1.0 500 Internal Server Error");
  6. die();

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  1. $verify->set_where('AND file="'. $_REQUEST['file'].'"');
  2. $verify->set_where('AND ext="'. $ext.'"');
  3. $verify->set_order('position', 'ASC');
  4. $verify->select();
  5. if($verify->_num_rows>=1){exit;}

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. $NewPage = new MySQL();
  7. $NewPage->set_table(PREFIX_TABLES . 'ws_link_url_file');
  8. $NewPage->set_Insert('file', $_REQUEST['file']);
  9. $NewPage->set_Insert('id_url', $_REQUEST['idPage']);
  1. if (empty($_GET['ws_nivel'])) {
  2. $_GET['ws_nivel'] = '0';
  3. }
  4. if (empty($_GET['ws_id_ferramenta'])) {
  5. die("Empty _GET['ws_id_ferramenta'] ");

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. }
  7. if(empty($_GET['LIMIT'])) {$_GET['LIMIT']="50";}
  8. if(empty($_GET['PAGE'])) {$_GET['PAGE']="1";}
  1. $_biblioteca_->set_insert('token', $token);
  2. $_biblioteca_->set_insert('type', $type);
  3. $_biblioteca_->set_insert('upload_size',filesize(INCLUDE_PATH.'website/assets/upload-files/'.$nome_novo));
  4. $_biblioteca_->insert();
  5. echo ws::create_thumbnail(INCLUDE_PATH.'website/assets/upload-files/'.$nome_novo, 200, 200,100)->rootPath;
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. ?>
  1. }
  2. function LoadDadosUser(){
  3. $user = new Session();
  4. if($_REQUEST['iD']=='undefined'){ echo "ID de usuario não encontrado."; exit; };

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  5. $s = new MySQL();
  6. $s->set_table(PREFIX_TABLES.'ws_usuarios');
  7. $s->set_where('id="'.$_REQUEST['iD'].'"');
  8. $s->select();
  1. $U->set_update('add_user',$_REQUEST['add_user']);
  2. $U->set_update('edit_only_own',$_REQUEST['edit_only_own']);
  3. $U->set_update('leitura',$_REQUEST['leitura']);
  4. if($U->salvar()){
  5. echo "Usuário salvo com sucesso!";exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. };
  7. }
  8. //####################################################################################################################
  9. //####################################################################################################################
  1. include(INCLUDE_PATH.'admin/app/lib/class-ws-v1.php');
  2. #####################################################
  3. # VERIFICA SE ESTAMOS USANDO O MODO "INSECURE"
  4. #####################################################
  5. if(SECURE===FALSE) die(_erro(" NÃO É POSSÍVEL ACESSAR O GERENCIADOR DE USUÁRIOS NO MODO 'INSECURE'"));

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. #####################################################
  7. # CRIA SESSÃO
  8. #####################################################
  9. $user = new session();
  1. include(INCLUDE_PATH.'admin/app/lib/class-ws-v1.php');
  2. #####################################################
  3. # VERIFICA SE ESTAMOS USANDO O MODO "INSECURE"
  4. #####################################################
  5. if(SECURE===FALSE) die(_erro(" NÃO É POSSÍVEL ACESSAR O GERENCIADOR DE USUÁRIOS NO MODO 'INSECURE'"));

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. #####################################################
  7. # CRIA SESSÃO
  8. #####################################################
  9. $user = new session();
in admin/index.php, line 53
  1. ############################################################################################################################
  2. # CASO NÃO EXISTA O 'ws-config.php' IMPORTA A TELA DE SETUP
  3. ############################################################################################################################
  4. if(!file_exists(INCLUDE_PATH.'ws-config.php')) {
  5. include_once(INCLUDE_PATH.'admin/app/core/ws-setup.php');
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. ############################################################################################################################################
  9. # ANTES DE TUDO, VERIFICA SE JÁ TEMOS AS VARIÁVEIS NO HTACCESS E SE ESTÃO CORRETAS
  10. ############################################################################################################################################
in admin/index.php, line 71
  1. ############################################################################################################################
  2. # CASO SEJA O 1° ACESSO, IMPORTA A TELA DE INSTALAÇÃO
  3. ############################################################################################################################
  4. if(file_exists(INCLUDE_PATH.'admin/app/config/firstacess') && file_get_contents(INCLUDE_PATH.'admin/app/config/firstacess')=='true'){
  5. include(INCLUDE_PATH.'admin/app/core/ws-install.php');exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. }
  7. ############################################################################################################################
  8. # CASO ESTEJA LOGADO DIRETAMENTE COM ACCESSKEY
  9. ############################################################################################################################
in admin/index.php, line 104
  1. SECURE==FALSE ||
  2. (isset($authKey) && $authKey == true) ||
  3. $log_session->verifyLogin() == true
  4. ){
  5. include(INCLUDE_PATH.'admin/app/core/ws-dashboard.php');
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. }
  8. ############################################################################################################################
  9. # CASO ESTEJA OFFLINE JÁ DIRECIONA PRO LOGIN
  10. ############################################################################################################################

PHP configuration should not be changed dynamically 4

  • Major
  • Bugrisk

More information: https://insight.sensiolabs.com/what-we-analyse/php.dynamically_change_configuration

  1. <?php
  2. ini_set('display_errors', '0');

    Changing PHP configuration dynamically through ini_set() may create hard to debug errors.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  3. include('./classes/class-thumbnails.php');
  4. $imagem =$_REQUEST['img'];
  5. $largura =$_REQUEST['w'];
  1. * Require mcrypt, curl
  2. * @license GNU GPLv3 http://opensource.org/licenses/gpl-3.0.html
  3. * @author ZonD80
  4. */
  5. ini_set("allow_url_fopen", "On");

    Changing PHP configuration dynamically through ini_set() may create hard to debug errors.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. require 'admin/app/lib/class-zip-progress.php';
  7. require 'admin/app/lib/class-http-lib.php';
  8. class MEGA
  9. {
  1. <?php
  2. $time_limit = ini_get('max_execution_time');
  3. $memory_limit = ini_get('memory_limit');
  4. set_time_limit(0);
  5. set_time_limit($time_limit);
  6. ini_set('memory_limit', $memory_limit);

    Changing PHP configuration dynamically through ini_set() may create hard to debug errors.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. ini_set('memory_limit', '-1');
  8. ############################################################################################################################################
  9. # DEFINIMOS O ROOT DO SISTEMA
  10. ############################################################################################################################################
  1. $time_limit = ini_get('max_execution_time');
  2. $memory_limit = ini_get('memory_limit');
  3. set_time_limit(0);
  4. set_time_limit($time_limit);
  5. ini_set('memory_limit', $memory_limit);
  6. ini_set('memory_limit', '-1');

    Changing PHP configuration dynamically through ini_set() may create hard to debug errors.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. ############################################################################################################################################
  8. # DEFINIMOS O ROOT DO SISTEMA
  9. ############################################################################################################################################
  10. if(!defined("ROOT_WEBSHEEP")) {

Files should be encoded in UTF-8

  • Major
  • Bugrisk

More information: https://insight.sensiolabs.com/what-we-analyse/web.non_utf8_encoding

This file uses iso-8859-1 text encoding. Prefer UTF-8 to avoid cross-encoding issues.

Time to fix: about 30 minutes
Open Issue Permalink
Last edited by Israel Nogueira

sleep() should not be used 3

  • Major
  • Performance

More information: https://insight.sensiolabs.com/what-we-analyse/php.use_php_sleep_function

  1. $File_LOCAL = './splitFiles/' . $item;
  2. $size_ftp_file = $ftp->size($File_FTP);
  3. $size_local_file = filesize($File_LOCAL);
  4. $full = true;
  5. if (!$ftp->verifyFiles($file) || $size_ftp_file != $size_local_file) {
  6. sleep(3);

    sleep() may create timeouts without even protecting your application.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. goto inicia;
  8. }
  9. }
  10. }
  11. $ftp->put('/public_html/descompacta_WS_BKP.php', './descompacta_WS_BKP.php');
  1. }
  2. // $z->addFromString('index.php', $indexZip);
  3. if ($z->close()) {
  4. unlink('./' . $nome_bkp);
  5. sleep(0.5);

    sleep() may create timeouts without even protecting your application.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. rename('./WS_FTP_BKP.zip', $nome_bkp);
  7. echo json_encode(array(
  8. 'diretorios' => count($_dir_theme_),
  9. 'arquivos' => count($_files_theme_),
  10. 'namefile' => $nome_bkp,
  1. $this->connection = @ftp_ssl_connect($host, $this->port, $this->timeout);
  2. } else {
  3. $this->connection = @ftp_connect($host, $this->port, $this->timeout);
  4. }
  5. if ($this->connection == null) {
  6. sleep(2);

    sleep() may create timeouts without even protecting your application.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. $ftp->conection(1);
  8. } else {
  9. return 1;
  10. }
  11. }

Web applications should contain a favicon

  • Major
  • Performance

More information: https://insight.sensiolabs.com/what-we-analyse/web.missing_favicon

in ./

No favicon found in the web root directory

Time to fix: about 1 hour
Open Issue Permalink
Collective
  • ./

Source code should not contain TODO comments 27

  • Minor
  • Architecture

More information: https://insight.sensiolabs.com/what-we-analyse/task_todo_comment

  1. public function unregisterFunction($name) {
  2. unset($this->libFunctions[$name]);
  3. }
  4. // remove comments from $text
  5. // todo: make it work for all functions, not just url

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  6. function removeComments($text) {
  7. $look = array(
  8. 'url(', '//', '/*', '"', "'"
  9. );
  1. break;
  2. }
  3. }
  4. }
  5. } else {
  6. // TODO: Throw an exception? We got neither a string nor something

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. // that looks like a compatible lessphp cache structure.
  8. return null;
  9. }
  10. if ($root !== null) {
  1. * https://github.com/daviferreira/canvas
  2. *
  3. * @author Davi Ferreira <contato@daviferreira.com>
  4. * @version 1.0 $ 2010-05-21 19:56:33 $
  5. *
  6. * TODO:

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. */
  8. class canvas {
  9. // arquivos
  1. protected static $phoneDevices = array(
  2. 'iPhone' => '\biPhone\b|\biPod\b', // |\biTunes
  3. 'BlackBerry' => 'BlackBerry|\bBB10\b|rim[0-9]+',
  4. 'HTC' => 'HTC|HTC.*(Sensation|Evo|Vision|Explorer|6800|8100|8900|A7272|S510e|C110e|Legend|Desire|T8282)|APX515CKT|Qtek9090|APA9292KT|HD_mini|Sensation.*Z710e|PG86100|Z715e|Desire.*(A8181|HD)|ADR6200|ADR6400L|ADR6425|001HT|Inspire 4G|Android.*\bEVO\b|T-Mobile G1|Z520m',
  5. 'Nexus' => 'Nexus One|Nexus S|Galaxy.*Nexus|Android.*Nexus.*Mobile|Nexus 4|Nexus 5|Nexus 6',
  6. // @todo: Is 'Dell Streak' a tablet or a phone? ;)

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. 'Dell' => 'Dell.*Streak|Dell.*Aero|Dell.*Venue|DELL.*Venue Pro|Dell Flash|Dell Smoke|Dell Mini 3iX|XCD28|XCD35|\b001DL\b|\b101DL\b|\bGS01\b',
  8. 'Motorola' => 'Motorola|DROIDX|DROID BIONIC|\bDroid\b.*Build|Android.*Xoom|HRI39|MOT-|A1260|A1680|A555|A853|A855|A953|A955|A956|Motorola.*ELECTRIFY|Motorola.*i1|i867|i940|MB200|MB300|MB501|MB502|MB508|MB511|MB520|MB525|MB526|MB611|MB612|MB632|MB810|MB855|MB860|MB861|MB865|MB870|ME501|ME502|ME511|ME525|ME600|ME632|ME722|ME811|ME860|ME863|ME865|MT620|MT710|MT716|MT720|MT810|MT870|MT917|Motorola.*TITANIUM|WX435|WX445|XT300|XT301|XT311|XT316|XT317|XT319|XT320|XT390|XT502|XT530|XT531|XT532|XT535|XT603|XT610|XT611|XT615|XT681|XT701|XT702|XT711|XT720|XT800|XT806|XT860|XT862|XT875|XT882|XT883|XT894|XT901|XT907|XT909|XT910|XT912|XT928|XT926|XT915|XT919|XT925|XT1021|\bMoto E\b',
  9. 'Samsung' => '\bSamsung\b|SM-G9250|GT-19300|SGH-I337|BGT-S5230|GT-B2100|GT-B2700|GT-B2710|GT-B3210|GT-B3310|GT-B3410|GT-B3730|GT-B3740|GT-B5510|GT-B5512|GT-B5722|GT-B6520|GT-B7300|GT-B7320|GT-B7330|GT-B7350|GT-B7510|GT-B7722|GT-B7800|GT-C3010|GT-C3011|GT-C3060|GT-C3200|GT-C3212|GT-C3212I|GT-C3262|GT-C3222|GT-C3300|GT-C3300K|GT-C3303|GT-C3303K|GT-C3310|GT-C3322|GT-C3330|GT-C3350|GT-C3500|GT-C3510|GT-C3530|GT-C3630|GT-C3780|GT-C5010|GT-C5212|GT-C6620|GT-C6625|GT-C6712|GT-E1050|GT-E1070|GT-E1075|GT-E1080|GT-E1081|GT-E1085|GT-E1087|GT-E1100|GT-E1107|GT-E1110|GT-E1120|GT-E1125|GT-E1130|GT-E1160|GT-E1170|GT-E1175|GT-E1180|GT-E1182|GT-E1200|GT-E1210|GT-E1225|GT-E1230|GT-E1390|GT-E2100|GT-E2120|GT-E2121|GT-E2152|GT-E2220|GT-E2222|GT-E2230|GT-E2232|GT-E2250|GT-E2370|GT-E2550|GT-E2652|GT-E3210|GT-E3213|GT-I5500|GT-I5503|GT-I5700|GT-I5800|GT-I5801|GT-I6410|GT-I6420|GT-I7110|GT-I7410|GT-I7500|GT-I8000|GT-I8150|GT-I8160|GT-I8190|GT-I8320|GT-I8330|GT-I8350|GT-I8530|GT-I8700|GT-I8703|GT-I8910|GT-I9000|GT-I9001|GT-I9003|GT-I9010|GT-I9020|GT-I9023|GT-I9070|GT-I9082|GT-I9100|GT-I9103|GT-I9220|GT-I9250|GT-I9300|GT-I9305|GT-I9500|GT-I9505|GT-M3510|GT-M5650|GT-M7500|GT-M7600|GT-M7603|GT-M8800|GT-M8910|GT-N7000|GT-S3110|GT-S3310|GT-S3350|GT-S3353|GT-S3370|GT-S3650|GT-S3653|GT-S3770|GT-S3850|GT-S5210|GT-S5220|GT-S5229|GT-S5230|GT-S5233|GT-S5250|GT-S5253|GT-S5260|GT-S5263|GT-S5270|GT-S5300|GT-S5330|GT-S5350|GT-S5360|GT-S5363|GT-S5369|GT-S5380|GT-S5380D|GT-S5560|GT-S5570|GT-S5600|GT-S5603|GT-S5610|GT-S5620|GT-S5660|GT-S5670|GT-S5690|GT-S5750|GT-S5780|GT-S5830|GT-S5839|GT-S6102|GT-S6500|GT-S7070|GT-S7200|GT-S7220|GT-S7230|GT-S7233|GT-S7250|GT-S7500|GT-S7530|GT-S7550|GT-S7562|GT-S7710|GT-S8000|GT-S8003|GT-S8500|GT-S8530|GT-S8600|SCH-A310|SCH-A530|SCH-A570|SCH-A610|SCH-A630|SCH-A650|SCH-A790|SCH-A795|SCH-A850|SCH-A870|SCH-A890|SCH-A930|SCH-A950|SCH-A970|SCH-A990|SCH-I100|SCH-I110|SCH-I400|SCH-I405|SCH-I500|SCH-I510|SCH-I515|SCH-I600|SCH-I730|SCH-I760|SCH-I770|SCH-I830|SCH-I910|SCH-I920|SCH-I959|SCH-LC11|SCH-N150|SCH-N300|SCH-R100|SCH-R300|SCH-R351|SCH-R400|SCH-R410|SCH-T300|SCH-U310|SCH-U320|SCH-U350|SCH-U360|SCH-U365|SCH-U370|SCH-U380|SCH-U410|SCH-U430|SCH-U450|SCH-U460|SCH-U470|SCH-U490|SCH-U540|SCH-U550|SCH-U620|SCH-U640|SCH-U650|SCH-U660|SCH-U700|SCH-U740|SCH-U750|SCH-U810|SCH-U820|SCH-U900|SCH-U940|SCH-U960|SCS-26UC|SGH-A107|SGH-A117|SGH-A127|SGH-A137|SGH-A157|SGH-A167|SGH-A177|SGH-A187|SGH-A197|SGH-A227|SGH-A237|SGH-A257|SGH-A437|SGH-A517|SGH-A597|SGH-A637|SGH-A657|SGH-A667|SGH-A687|SGH-A697|SGH-A707|SGH-A717|SGH-A727|SGH-A737|SGH-A747|SGH-A767|SGH-A777|SGH-A797|SGH-A817|SGH-A827|SGH-A837|SGH-A847|SGH-A867|SGH-A877|SGH-A887|SGH-A897|SGH-A927|SGH-B100|SGH-B130|SGH-B200|SGH-B220|SGH-C100|SGH-C110|SGH-C120|SGH-C130|SGH-C140|SGH-C160|SGH-C170|SGH-C180|SGH-C200|SGH-C207|SGH-C210|SGH-C225|SGH-C230|SGH-C417|SGH-C450|SGH-D307|SGH-D347|SGH-D357|SGH-D407|SGH-D415|SGH-D780|SGH-D807|SGH-D980|SGH-E105|SGH-E200|SGH-E315|SGH-E316|SGH-E317|SGH-E335|SGH-E590|SGH-E635|SGH-E715|SGH-E890|SGH-F300|SGH-F480|SGH-I200|SGH-I300|SGH-I320|SGH-I550|SGH-I577|SGH-I600|SGH-I607|SGH-I617|SGH-I627|SGH-I637|SGH-I677|SGH-I700|SGH-I717|SGH-I727|SGH-i747M|SGH-I777|SGH-I780|SGH-I827|SGH-I847|SGH-I857|SGH-I896|SGH-I897|SGH-I900|SGH-I907|SGH-I917|SGH-I927|SGH-I937|SGH-I997|SGH-J150|SGH-J200|SGH-L170|SGH-L700|SGH-M110|SGH-M150|SGH-M200|SGH-N105|SGH-N500|SGH-N600|SGH-N620|SGH-N625|SGH-N700|SGH-N710|SGH-P107|SGH-P207|SGH-P300|SGH-P310|SGH-P520|SGH-P735|SGH-P777|SGH-Q105|SGH-R210|SGH-R220|SGH-R225|SGH-S105|SGH-S307|SGH-T109|SGH-T119|SGH-T139|SGH-T209|SGH-T219|SGH-T229|SGH-T239|SGH-T249|SGH-T259|SGH-T309|SGH-T319|SGH-T329|SGH-T339|SGH-T349|SGH-T359|SGH-T369|SGH-T379|SGH-T409|SGH-T429|SGH-T439|SGH-T459|SGH-T469|SGH-T479|SGH-T499|SGH-T509|SGH-T519|SGH-T539|SGH-T559|SGH-T589|SGH-T609|SGH-T619|SGH-T629|SGH-T639|SGH-T659|SGH-T669|SGH-T679|SGH-T709|SGH-T719|SGH-T729|SGH-T739|SGH-T746|SGH-T749|SGH-T759|SGH-T769|SGH-T809|SGH-T819|SGH-T839|SGH-T919|SGH-T929|SGH-T939|SGH-T959|SGH-T989|SGH-U100|SGH-U200|SGH-U800|SGH-V205|SGH-V206|SGH-X100|SGH-X105|SGH-X120|SGH-X140|SGH-X426|SGH-X427|SGH-X475|SGH-X495|SGH-X497|SGH-X507|SGH-X600|SGH-X610|SGH-X620|SGH-X630|SGH-X700|SGH-X820|SGH-X890|SGH-Z130|SGH-Z150|SGH-Z170|SGH-ZX10|SGH-ZX20|SHW-M110|SPH-A120|SPH-A400|SPH-A420|SPH-A460|SPH-A500|SPH-A560|SPH-A600|SPH-A620|SPH-A660|SPH-A700|SPH-A740|SPH-A760|SPH-A790|SPH-A800|SPH-A820|SPH-A840|SPH-A880|SPH-A900|SPH-A940|SPH-A960|SPH-D600|SPH-D700|SPH-D710|SPH-D720|SPH-I300|SPH-I325|SPH-I330|SPH-I350|SPH-I500|SPH-I600|SPH-I700|SPH-L700|SPH-M100|SPH-M220|SPH-M240|SPH-M300|SPH-M305|SPH-M320|SPH-M330|SPH-M350|SPH-M360|SPH-M370|SPH-M380|SPH-M510|SPH-M540|SPH-M550|SPH-M560|SPH-M570|SPH-M580|SPH-M610|SPH-M620|SPH-M630|SPH-M800|SPH-M810|SPH-M850|SPH-M900|SPH-M910|SPH-M920|SPH-M930|SPH-N100|SPH-N200|SPH-N240|SPH-N300|SPH-N400|SPH-Z400|SWC-E100|SCH-i909|GT-N7100|GT-N7105|SCH-I535|SM-N900A|SGH-I317|SGH-T999L|GT-S5360B|GT-I8262|GT-S6802|GT-S6312|GT-S6310|GT-S5312|GT-S5310|GT-I9105|GT-I8510|GT-S6790N|SM-G7105|SM-N9005|GT-S5301|GT-I9295|GT-I9195|SM-C101|GT-S7392|GT-S7560|GT-B7610|GT-I5510|GT-S7582|GT-S7530E|GT-I8750|SM-G9006V|SM-G9008V|SM-G9009D|SM-G900A|SM-G900D|SM-G900F|SM-G900H|SM-G900I|SM-G900J|SM-G900K|SM-G900L|SM-G900M|SM-G900P|SM-G900R4|SM-G900S|SM-G900T|SM-G900V|SM-G900W8|SHV-E160K|SCH-P709|SCH-P729|SM-T2558|GT-I9205|SM-G9350|SM-J120F|SM-G920F|SM-G920V|SM-G930F|SM-N910C',
  10. 'LG' => '\bLG\b;|LG[- ]?(C800|C900|E400|E610|E900|E-900|F160|F180K|F180L|F180S|730|855|L160|LS740|LS840|LS970|LU6200|MS690|MS695|MS770|MS840|MS870|MS910|P500|P700|P705|VM696|AS680|AS695|AX840|C729|E970|GS505|272|C395|E739BK|E960|L55C|L75C|LS696|LS860|P769BK|P350|P500|P509|P870|UN272|US730|VS840|VS950|LN272|LN510|LS670|LS855|LW690|MN270|MN510|P509|P769|P930|UN200|UN270|UN510|UN610|US670|US740|US760|UX265|UX840|VN271|VN530|VS660|VS700|VS740|VS750|VS910|VS920|VS930|VX9200|VX11000|AX840A|LW770|P506|P925|P999|E612|D955|D802|MS323)',
  11. 'Sony' => 'SonyST|SonyLT|SonyEricsson|SonyEricssonLT15iv|LT18i|E10i|LT28h|LT26w|SonyEricssonMT27i|C5303|C6902|C6903|C6906|C6943|D2533',
  1. 'Asus' => 'Asus.*Galaxy|PadFone.*Mobile',
  2. 'NokiaLumia' => 'Lumia [0-9]{3,4}',
  3. // http://www.micromaxinfo.com/mobiles/smartphones
  4. // Added because the codes might conflict with Acer Tablets.
  5. 'Micromax' => 'Micromax.*\b(A210|A92|A88|A72|A111|A110Q|A115|A116|A110|A90S|A26|A51|A35|A54|A25|A27|A89|A68|A65|A57|A90)\b',
  6. // @todo Complete the regex.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. 'Palm' => 'PalmSource|Palm', // avantgo|blazer|elaine|hiptop|plucker|xiino ;
  8. 'Vertu' => 'Vertu|Vertu.*Ltd|Vertu.*Ascent|Vertu.*Ayxta|Vertu.*Constellation(F|Quest)?|Vertu.*Monika|Vertu.*Signature', // Just for fun ;)
  9. // http://www.pantech.co.kr/en/prod/prodList.do?gbrand=VEGA (PANTECH)
  10. // Most of the VEGA devices are legacy. PANTECH seem to be newer devices based on Android.
  11. 'Pantech' => 'PANTECH|IM-A850S|IM-A840S|IM-A830L|IM-A830K|IM-A830S|IM-A820L|IM-A810K|IM-A810S|IM-A800S|IM-T100K|IM-A725L|IM-A780L|IM-A775C|IM-A770K|IM-A760S|IM-A750K|IM-A740S|IM-A730S|IM-A720L|IM-A710K|IM-A690L|IM-A690S|IM-A650S|IM-A630K|IM-A600S|VEGA PTL21|PT003|P8010|ADR910L|P6030|P6020|P9070|P4100|P9060|P5000|CDM8992|TXT8045|ADR8995|IS11PT|P2030|P6010|P8000|PT002|IS06|CDM8999|P9050|PT001|TXT8040|P2020|P9020|P2000|P7040|P7000|C790',
  1. * List of tablet devices.
  2. *
  3. * @var array
  4. */
  5. protected static $tabletDevices = array(
  6. // @todo: check for mobile friendly emails topic.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. 'iPad' => 'iPad|iPad.*Mobile',
  8. // Removed |^.*Android.*Nexus(?!(?:Mobile).)*$
  9. // @see #442
  10. 'NexusTablet' => 'Android.*Nexus[\s]+(7|9|10)',
  11. 'SamsungTablet' => 'SAMSUNG.*Tablet|Galaxy.*Tab|SC-01C|GT-P1000|GT-P1003|GT-P1010|GT-P3105|GT-P6210|GT-P6800|GT-P6810|GT-P7100|GT-P7300|GT-P7310|GT-P7500|GT-P7510|SCH-I800|SCH-I815|SCH-I905|SGH-I957|SGH-I987|SGH-T849|SGH-T859|SGH-T869|SPH-P100|GT-P3100|GT-P3108|GT-P3110|GT-P5100|GT-P5110|GT-P6200|GT-P7320|GT-P7511|GT-N8000|GT-P8510|SGH-I497|SPH-P500|SGH-T779|SCH-I705|SCH-I915|GT-N8013|GT-P3113|GT-P5113|GT-P8110|GT-N8010|GT-N8005|GT-N8020|GT-P1013|GT-P6201|GT-P7501|GT-N5100|GT-N5105|GT-N5110|SHV-E140K|SHV-E140L|SHV-E140S|SHV-E150S|SHV-E230K|SHV-E230L|SHV-E230S|SHW-M180K|SHW-M180L|SHW-M180S|SHW-M180W|SHW-M300W|SHW-M305W|SHW-M380K|SHW-M380S|SHW-M380W|SHW-M430W|SHW-M480K|SHW-M480S|SHW-M480W|SHW-M485W|SHW-M486W|SHW-M500W|GT-I9228|SCH-P739|SCH-I925|GT-I9200|GT-P5200|GT-P5210|GT-P5210X|SM-T311|SM-T310|SM-T310X|SM-T210|SM-T210R|SM-T211|SM-P600|SM-P601|SM-P605|SM-P900|SM-P901|SM-T217|SM-T217A|SM-T217S|SM-P6000|SM-T3100|SGH-I467|XE500|SM-T110|GT-P5220|GT-I9200X|GT-N5110X|GT-N5120|SM-P905|SM-T111|SM-T2105|SM-T315|SM-T320|SM-T320X|SM-T321|SM-T520|SM-T525|SM-T530NU|SM-T230NU|SM-T330NU|SM-T900|XE500T1C|SM-P605V|SM-P905V|SM-T337V|SM-T537V|SM-T707V|SM-T807V|SM-P600X|SM-P900X|SM-T210X|SM-T230|SM-T230X|SM-T325|GT-P7503|SM-T531|SM-T330|SM-T530|SM-T705|SM-T705C|SM-T535|SM-T331|SM-T800|SM-T700|SM-T537|SM-T807|SM-P907A|SM-T337A|SM-T537A|SM-T707A|SM-T807A|SM-T237|SM-T807P|SM-P607T|SM-T217T|SM-T337T|SM-T807T|SM-T116NQ|SM-P550|SM-T350|SM-T550|SM-T9000|SM-P9000|SM-T705Y|SM-T805|GT-P3113|SM-T710|SM-T810|SM-T815|SM-T360|SM-T533|SM-T113|SM-T335|SM-T715|SM-T560|SM-T670|SM-T677|SM-T377|SM-T567|SM-T357T|SM-T555|SM-T561|SM-T713|SM-T719|SM-T813|SM-T819|SM-T580|SM-T355Y|SM-T280|SM-T817A|SM-T820|SM-W700|SM-P580|SM-T587', // SCH-P709|SCH-P729|SM-T2558|GT-I9205 - Samsung Mega - treat them like a regular phone.
  1. // http://www.yarvik.com/en/matrix/tablets/
  2. 'YarvikTablet' => 'Android.*\b(TAB210|TAB211|TAB224|TAB250|TAB260|TAB264|TAB310|TAB360|TAB364|TAB410|TAB411|TAB420|TAB424|TAB450|TAB460|TAB461|TAB464|TAB465|TAB467|TAB468|TAB07-100|TAB07-101|TAB07-150|TAB07-151|TAB07-152|TAB07-200|TAB07-201-3G|TAB07-210|TAB07-211|TAB07-212|TAB07-214|TAB07-220|TAB07-400|TAB07-485|TAB08-150|TAB08-200|TAB08-201-3G|TAB08-201-30|TAB09-100|TAB09-211|TAB09-410|TAB10-150|TAB10-201|TAB10-211|TAB10-400|TAB10-410|TAB13-201|TAB274EUK|TAB275EUK|TAB374EUK|TAB462EUK|TAB474EUK|TAB9-200)\b',
  3. 'MedionTablet' => 'Android.*\bOYO\b|LIFE.*(P9212|P9514|P9516|S9512)|LIFETAB',
  4. 'ArnovaTablet' => '97G4|AN10G2|AN7bG3|AN7fG3|AN8G3|AN8cG3|AN7G3|AN9G3|AN7dG3|AN7dG3ST|AN7dG3ChildPad|AN10bG3|AN10bG3DT|AN9G2',
  5. // http://www.intenso.de/kategorie_en.php?kategorie=33
  6. // @todo: http://www.nbhkdz.com/read/b8e64202f92a2df129126bff.html - investigate

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. 'IntensoTablet' => 'INM8002KP|INM1010FP|INM805ND|Intenso Tab|TAB1004',
  8. // IRU.ru Tablets http://www.iru.ru/catalog/soho/planetable/
  9. 'IRUTablet' => 'M702pro',
  10. 'MegafonTablet' => 'MegaFon V9|\bZTE V9\b|Android.*\bMT7A\b',
  11. // http://www.e-boda.ro/tablete-pc.html
  1. // @note Rewrite the regex format after we add more UAs.
  2. 'ArchosTablet' => '\b(101G9|80G9|A101IT)\b|Qilive 97R|Archos5|\bARCHOS (70|79|80|90|97|101|FAMILYPAD|)(b|c|)(G10| Cobalt| TITANIUM(HD|)| Xenon| Neon|XSK| 2| XS 2| PLATINUM| CARBON|GAMEPAD)\b',
  3. // http://www.ainol.com/plugin.php?identifier=ainol&module=product
  4. 'AinolTablet' => 'NOVO7|NOVO8|NOVO10|Novo7Aurora|Novo7Basic|NOVO7PALADIN|novo9-Spark',
  5. 'NokiaLumiaTablet' => 'Lumia 2520',
  6. // @todo: inspect http://esupport.sony.com/US/p/select-system.pl?DIRECTOR=DRIVER

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. // Readers http://www.atsuhiro-me.net/ebook/sony-reader/sony-reader-web-browser
  8. // http://www.sony.jp/support/tablet/
  9. 'SonyTablet' => 'Sony.*Tablet|Xperia Tablet|Sony Tablet S|SO-03E|SGPT12|SGPT13|SGPT114|SGPT121|SGPT122|SGPT123|SGPT111|SGPT112|SGPT113|SGPT131|SGPT132|SGPT133|SGPT211|SGPT212|SGPT213|SGP311|SGP312|SGP321|EBRD1101|EBRD1102|EBRD1201|SGP351|SGP341|SGP511|SGP512|SGP521|SGP541|SGP551|SGP621|SGP612|SOT31',
  10. // http://www.support.philips.com/support/catalog/worldproducts.jsp?userLanguage=en&userCountry=cn&categoryid=3G_LTE_TABLET_SU_CN_CARE&title=3G%20tablets%20/%20LTE%20range&_dyncharset=UTF-8
  11. 'PhilipsTablet' => '\b(PI2010|PI3000|PI3100|PI3105|PI3110|PI3205|PI3210|PI3900|PI4010|PI7000|PI7100)\b',
  1. // http://www.cobyusa.com/?p=pcat&pcat_id=3001
  2. 'CobyTablet' => 'MID1042|MID1045|MID1125|MID1126|MID7012|MID7014|MID7015|MID7034|MID7035|MID7036|MID7042|MID7048|MID7127|MID8042|MID8048|MID8127|MID9042|MID9740|MID9742|MID7022|MID7010',
  3. // http://www.match.net.cn/products.asp
  4. 'MIDTablet' => 'M9701|M9000|M9100|M806|M1052|M806|T703|MID701|MID713|MID710|MID727|MID760|MID830|MID728|MID933|MID125|MID810|MID732|MID120|MID930|MID800|MID731|MID900|MID100|MID820|MID735|MID980|MID130|MID833|MID737|MID960|MID135|MID860|MID736|MID140|MID930|MID835|MID733|MID4X10',
  5. // http://www.msi.com/support
  6. // @todo Research the Windows Tablets.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. 'MSITablet' => 'MSI \b(Primo 73K|Primo 73L|Primo 81L|Primo 77|Primo 93|Primo 75|Primo 76|Primo 73|Primo 81|Primo 91|Primo 90|Enjoy 71|Enjoy 7|Enjoy 10)\b',
  8. // @todo http://www.kyoceramobile.com/support/drivers/
  9. // 'KyoceraTablet' => null,
  10. // @todo http://intexuae.com/index.php/category/mobile-devices/tablets-products/
  11. // 'IntextTablet' => null,
  1. // http://www.match.net.cn/products.asp
  2. 'MIDTablet' => 'M9701|M9000|M9100|M806|M1052|M806|T703|MID701|MID713|MID710|MID727|MID760|MID830|MID728|MID933|MID125|MID810|MID732|MID120|MID930|MID800|MID731|MID900|MID100|MID820|MID735|MID980|MID130|MID833|MID737|MID960|MID135|MID860|MID736|MID140|MID930|MID835|MID733|MID4X10',
  3. // http://www.msi.com/support
  4. // @todo Research the Windows Tablets.
  5. 'MSITablet' => 'MSI \b(Primo 73K|Primo 73L|Primo 81L|Primo 77|Primo 93|Primo 75|Primo 76|Primo 73|Primo 81|Primo 91|Primo 90|Enjoy 71|Enjoy 7|Enjoy 10)\b',
  6. // @todo http://www.kyoceramobile.com/support/drivers/

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. // 'KyoceraTablet' => null,
  8. // @todo http://intexuae.com/index.php/category/mobile-devices/tablets-products/
  9. // 'IntextTablet' => null,
  10. // http://pdadb.net/index.php?m=pdalist&list=SMiT (NoName Chinese Tablets)
  11. // http://www.imp3.net/14/show.php?itemid=20454
  1. // http://www.msi.com/support
  2. // @todo Research the Windows Tablets.
  3. 'MSITablet' => 'MSI \b(Primo 73K|Primo 73L|Primo 81L|Primo 77|Primo 93|Primo 75|Primo 76|Primo 73|Primo 81|Primo 91|Primo 90|Enjoy 71|Enjoy 7|Enjoy 10)\b',
  4. // @todo http://www.kyoceramobile.com/support/drivers/
  5. // 'KyoceraTablet' => null,
  6. // @todo http://intexuae.com/index.php/category/mobile-devices/tablets-products/

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Israel Nogueira
  7. // 'IntextTablet' => null,
  8. // http://pdadb.net/index.php?m=pdalist&list=SMiT (NoName Chinese Tablets)
  9. // http://www.imp3.net/14/show.php?itemid=20454
  10. 'SMiTTablet' => 'Android.*(\bMID\b|MID-560|MTV-T1200|MTV-PND531|MTV-P1101|MTV-PND530)',
  11. // http://www.rock-chips.com/index.php?do=prod&pid=2
  1. // China manufacturer makes tablets for different small brands (eg. http://www.zeepad.net/index.html)
  2. 'ChangJiaTablet' => 'TPC7102|TPC7103|TPC7105|TPC7106|TPC7107|TPC7201|TPC7203|TPC7205|TPC7210|TPC7708|TPC7709|TPC7712|TPC7110|TPC8101|TPC8103|TPC8105|TPC8106|TPC8203|TPC8205|TPC8503|TPC9106|TPC9701|TPC97101|TPC97103|TPC97105|TPC97106|TPC97111|TPC97113|TPC97203|TPC97603|TPC97809|TPC97205|TPC10101|TPC10103|TPC10106|TPC10111|TPC10203|TPC10205|TPC10503',
  3. // http://www.gloryunion.cn/products.asp
  4. // http://www.allwinnertech.com/en/apply/mobile.html
  5. // http://www.ptcl.com.pk/pd_content.php?pd_id=284 (EVOTAB)
  6. // @todo: Softwiner tablets?

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours