Skip to content

Commit c5409c7

Browse files
authored
Add files via upload
1 parent 31929d7 commit c5409c7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

url.class.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* 16/01/2021 -> getIdAntes (refatorado método)
1616
* 16/01/2021 -> Renomeado método gerarLinkWebsite para gerarLinkInterno
1717
* 20/01/2021 -> Melhorada performance geral da classe
18+
* 20/01/2021 -> Renomeado método tratar para URLizer
1819
*/
1920

2021
class url {
@@ -96,7 +97,7 @@ public function agora() {
9697
* @return bool Verifica se possui o o que for informado aqui na url. Se tiver, retorna true.
9798
*/
9899
public function contem($palavra) {
99-
if ((in_array($palavra, $this->partes)) || ( in_array($this->tratar($palavra), $this->partes)) || $this->get($palavra)!=="" || preg_match("/$palavra/", implode('/',$this->partes))) {
100+
if ($palavra!=="" && ((in_array($palavra, $this->partes)) || ( in_array($this->URLizer($palavra), $this->partes)) || $this->get($palavra)!=="" || preg_match("/$palavra/", implode('/',$this->partes)))) {
100101
return true;
101102
} else {
102103
return false;
@@ -183,7 +184,7 @@ public function getURLApos($palavra) {
183184
* @return int $id Retorna a ID que está depois da palavra informada
184185
*/
185186
public function getIdApos($palavra) {
186-
return $this->getId($this->getApos($this->tratar($palavra),true));
187+
return $this->getId($this->getApos($this->URLizer($palavra),true));
187188
}
188189

189190
/**
@@ -237,7 +238,7 @@ public function getURLAntes($palavra) {
237238
* @return int $id Retorna a ID que está antes da palavra informada.
238239
*/
239240
public function getIdAntes($palavra) {
240-
return $this->getId($this->getAntes($this->tratar($palavra),true));
241+
return $this->getId($this->getAntes($this->URLizer($palavra),true));
241242
}
242243

243244
/**

0 commit comments

Comments
 (0)