Issues (102)

Security Analysis    no request data  

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

src/Phiber/Util/FuncoesString.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
/**
4
 * Copyright (c) 2017. Este código foi feito por @marciioluucas, sob licença MIT
5
 */
6
namespace Phiber\Util;
7
8
/**
9
 *
10
 * Classe responsável por manipular strings.
11
 * 
12
 * @package util
13
 */
14
class FuncoesString
15
{
16
    /**
17
     * Passa para caixa alta
18
     * 
19
     * @param  string $string
20
     * @return string
21
     */
22
    public function paraCaixaAlta($string)
23
    {
24
        return strtoupper($string);
25
    }
26
27
    /**
28
     * Passa para caixa baixa
29
     * 
30
     * @param  string $string
31
     * @return string
32
     */
33
    public function paraCaixaBaixa($string)
34
    {
35
        return strtolower($string);
36
    }
37
38
    /**
39
     * Verifica se a string é existente, se caso não for, retornará false.
40
     * 
41
     * @param  string $string
42
     * @param  string $stringBuscada
43
     * @return bool
44
     */
45
    public function verificaStringExistente($string, $stringBuscada)
46
    {
47
        if (strpos($string, $stringBuscada) !== false) {
48
            return true;
49
        }
50
51
        return false;
52
    }
53
54
    /**
55
     * Passa a primeira letra da string para caixa alta.
56
     * 
57
     * @param  string $string
58
     * @return string
59
     */
60
    public function passarPrimeiraLetraParaCaixaAlta($string)
61
    {
62
        return ucfirst($string);
63
    }
64
65
    /**
66
     * Separa uma string.
67
     * 
68
     * @param  string $string
69
     * @param  int    $posicaoInicial
70
     * @param  int    $posicaoFinal   default null
71
     * @return string
72
     */
73
    public function separaString($string, $posicaoInicial, $posicaoFinal = null)
74
    {
75
        if ($posicaoFinal == null) {
0 ignored issues
show
Bug Best Practice introduced by
It seems like you are loosely comparing $posicaoFinal of type integer|null against null; this is ambiguous if the integer can be zero. Consider using a strict comparison === instead.
Loading history...
76
            return substr($string, $posicaoInicial - 1);
77
        }
78
79
        return substr($string, $posicaoInicial - 1, ($posicaoFinal - 1) * (-1));
80
    }
81
82
83
    /**
84
     * Retorna a posição da ocorrencia, se caso não existir, a função retornará false.
85
     * 
86
     * @param  string $string
87
     * @param  string $stringBusca
88
     * @return int
89
     */
90
    public function pegaPosStringDeterminada($string, $stringBusca)
91
    {
92
        $tamanhoStrBusca = strlen($stringBusca);
93
     
94
        return stripos($string, $stringBusca) + $tamanhoStrBusca + 1;
95
    }
96
97
    /**
98
     * Substitui ocorrencias de uma string. Se caso a ocorrencia não existir, a função retornará false.
99
     * 
100
     * @param  string $string
101
     * @param  string $stringBusca
102
     * @param  string $substituicao
103
     * @return mixed
104
     */
105
    public function substituiOcorrenciasDeUmaString($string, $stringBusca, $substituicao)
106
    {
107
        return str_replace($stringBusca, $substituicao, $string);
108
    }
109
}
110