Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
musica_listas_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Cristian Mauricio Diaz Canales
musica_listas_backend
Commits
bc84cc87
Commit
bc84cc87
authored
Dec 09, 2019
by
Cristian Mauricio Diaz Canales
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mejora validacion correo usuario
parent
494fc4f8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
29 deletions
+25
-29
src/Utilities/Utiles.php
src/Utilities/Utiles.php
+25
-29
No files found.
src/Utilities/Utiles.php
View file @
bc84cc87
...
...
@@ -90,9 +90,9 @@ class Utiles {
public
static
function
isWindowsChrome
(
$ua
)
{
$os
=
self
::
getOS
(
$ua
);
$browser
=
self
::
getBrowser
(
$ua
);
if
(
self
::
detectWord
(
$os
,
"Windows"
)
&&
self
::
detectWord
(
$browser
,
"Chrome"
))
{
if
(
self
::
detectWord
(
$os
,
"Windows"
)
&&
self
::
detectWord
(
$browser
,
"Chrome"
))
{
return
true
;
}
else
{
}
else
{
return
false
;
}
}
...
...
@@ -161,11 +161,10 @@ class Utiles {
return
$browser
;
}
public
static
function
acortarUrl
(
$data
){
public
static
function
acortarUrl
(
$data
)
{
$url
=
"http://url.gearlabs.cl/acortar"
;
$httpStatus
=
null
;
$httpStatus
=
null
;
try
{
$ch
=
curl_init
(
$url
);
curl_setopt
(
$ch
,
CURLOPT_POST
,
1
);
...
...
@@ -178,61 +177,58 @@ class Utiles {
if
(
$httpStatus
==
200
)
{
$arrayRetorno
=
json_decode
(
$output
,
true
);
return
$arrayRetorno
[
'shortLink'
];
}
else
{
return
$arrayRetorno
[
'shortLink'
];
}
else
{
return
array
(
'error'
=>
'httpStatus distinto de Response::HTTP_OK'
);
}
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
return
array
(
'error'
=>
'Error'
,
'detalle'
=>
$e
,
);
}
}
public
static
function
getUrlByTag
(
$tag
){
if
(
$tag
->
getTagId
()
==
1
)
{
public
static
function
getUrlByTag
(
$tag
)
{
if
(
$tag
->
getTagId
()
==
1
)
{
return
"http://new.entelmusic.cl"
;
}
else
if
(
$tag
->
getTagId
()
==
2
)
{
}
else
if
(
$tag
->
getTagId
()
==
2
)
{
return
"http://new.hitsahora.cl"
;
}
else
if
(
$tag
->
getTagId
()
==
3
)
{
}
else
if
(
$tag
->
getTagId
()
==
3
)
{
return
"http://new.umusic.cl"
;
}
else
if
(
$tag
->
getTagId
()
==
4
)
{
}
else
if
(
$tag
->
getTagId
()
==
4
)
{
return
"http://new.topsify.cl"
;
}
}
public
static
function
getParametroConfiguracion
(
$nombre
,
$em
)
{
public
static
function
getParametroConfiguracion
(
$nombre
,
$em
)
{
$str_valor
=
''
;
$parametro
=
$em
->
getRepository
(
PluParametroConfiguracion
::
class
)
->
getParametroConfiguracion
(
$nombre
);
//print_r($parametro);
//exit;
if
(
$parametro
)
$str_valor
=
$parametro
->
getPcoValor
();
return
$str_valor
;
}
/**
* FUNCIÓN PARA VALIDAR CORREO ELECTRÓNICO, MEDIANTE USO DE EXPRESIÓN REGULAR.
* @param type $email
* @return int
*/
public
static
function
validarCorreo
(
$email
=
""
)
{
$expresion_regular_correo
=
"/^[A-Z0-9._%+-]+@([A-Z0-9-]+\.)+[A-Z]
{
2,4
}
$/i"
;
if
(
preg_match
(
$expresion_regular_correo
,
$email
))
{
public
static
function
validarCorreo
(
$email
=
""
)
{
$expresion_regular_correo
=
"/^[A-Z0-9._%+-]+@([A-Z0-9-]+\.)+[A-Z]
{
2,4
}
$/i"
;
if
(
preg_match
(
$expresion_regular_correo
,
$email
))
{
return
1
;
}
else
{
}
else
{
return
0
;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment