mirror of
https://framagit.org/hubzilla/core.git
synced 2026-06-21 00:52:33 -04:00
test variable before using it
This commit is contained in:
@@ -33,7 +33,7 @@ class New_channel extends \Zotlabs\Web\Controller {
|
|||||||
// first name
|
// first name
|
||||||
if(strpos($x,' '))
|
if(strpos($x,' '))
|
||||||
$test[] = legal_webbie(substr($x,0,strpos($x,' ')));
|
$test[] = legal_webbie(substr($x,0,strpos($x,' ')));
|
||||||
if($test[0]) {
|
if (!empty($test[0])) {
|
||||||
// first name plus first initial of last
|
// first name plus first initial of last
|
||||||
$test[] = ((strpos($x,' ')) ? $test[0] . legal_webbie(trim(substr($x,strpos($x,' '),2))) : '');
|
$test[] = ((strpos($x,' ')) ? $test[0] . legal_webbie(trim(substr($x,strpos($x,' '),2))) : '');
|
||||||
// first name plus random number
|
// first name plus random number
|
||||||
@@ -69,7 +69,7 @@ class New_channel extends \Zotlabs\Web\Controller {
|
|||||||
// first name
|
// first name
|
||||||
if(strpos($x,' '))
|
if(strpos($x,' '))
|
||||||
$test[] = legal_webbie(substr($x,0,strpos($x,' ')));
|
$test[] = legal_webbie(substr($x,0,strpos($x,' ')));
|
||||||
if($test[0]) {
|
if (!empty($test[0])) {
|
||||||
// first name plus first initial of last
|
// first name plus first initial of last
|
||||||
$test[] = ((strpos($x,' ')) ? $test[0] . legal_webbie(trim(substr($x,strpos($x,' '),2))) : '');
|
$test[] = ((strpos($x,' ')) ? $test[0] . legal_webbie(trim(substr($x,strpos($x,' '),2))) : '');
|
||||||
// first name plus random number
|
// first name plus random number
|
||||||
|
|||||||
Reference in New Issue
Block a user