|
5770 | 5770 | $hosts = getMarzbanHosts($serverId)->inbounds; |
5771 | 5771 | $networkType = array(); |
5772 | 5772 | foreach($hosts as $key => $inbound){ |
5773 | | - $networkType[] = [['text'=>$inbound->tag, 'callback_data'=>"selectHost{$match[1]}_{$inbound->protocol}_{$inbound->tag}"]]; |
| 5773 | + $networkType[] = [['text'=>$inbound->tag, 'callback_data'=>"selectHost{$match[1]}*_*{$inbound->protocol}*_*{$inbound->tag}"]]; |
5774 | 5774 | } |
5775 | 5775 | $networkType[] = [['text'=>$buttonValues['cancel'], 'callback_data'=>"planDetails" . $match[1]]]; |
5776 | 5776 | $networkType = json_encode(['inline_keyboard'=>$networkType]); |
5777 | 5777 | editText($message_id, "لطفا نوع شبکه های این پلن را انتخاب کنید",$networkType); |
5778 | 5778 | } |
5779 | | -if(preg_match('/^selectHost(?<planId>\d+)_(?<protocol>.+)_(?<tag>.*)/',$data,$match) && ($from_id == $admin || $userInfo['isAdmin'] == true)){ |
| 5779 | +if(preg_match('/^selectHost(?<planId>\d+)\*_\*(?<protocol>.+)\*_\*(?<tag>.*)/',$data,$match) && ($from_id == $admin || $userInfo['isAdmin'] == true)){ |
5780 | 5780 | $saveBtn = "ذخیره ✅"; |
5781 | 5781 | unset($markup[count($markup)-1]); |
5782 | 5782 | if($markup[count($markup)-1][0]['text'] == $saveBtn) unset($markup[count($markup)-1]); |
|
5800 | 5800 | foreach($markup as $key=>$value){ |
5801 | 5801 | $tag = trim(str_replace("✅", "", $value[0]['text'], $state)); |
5802 | 5802 | if($state > 0){ |
5803 | | - preg_match('/^selectHost(?<serverId>\d+)_(?<protocol>.+)_(?<tag>.*)/',$value[0]['callback_data'],$info); |
| 5803 | + preg_match('/^selectHost(?<serverId>\d+)\*_\*(?<protocol>.+)\*_\*(?<tag>.*)/',$value[0]['callback_data'],$info); |
5804 | 5804 | $inbounds[$info['protocol']][] = $tag; |
5805 | 5805 | $proxies[$info['protocol']] = array(); |
5806 | 5806 |
|
|
6653 | 6653 | $hosts = getMarzbanHosts($serverId)->inbounds; |
6654 | 6654 | $networkType = array(); |
6655 | 6655 | foreach($hosts as $key => $inbound){ |
6656 | | - $networkType[] = [['text'=>$inbound->tag, 'callback_data'=>"planNetworkType{$inbound->protocol}_{$inbound->tag}"]]; |
| 6656 | + $networkType[] = [['text'=>$inbound->tag, 'callback_data'=>"planNetworkType{$inbound->protocol}*_*{$inbound->tag}"]]; |
6657 | 6657 | } |
6658 | 6658 | $networkType = json_encode(['inline_keyboard'=>$networkType]); |
6659 | 6659 |
|
|
6673 | 6673 | $stmt->close(); |
6674 | 6674 |
|
6675 | 6675 | } |
6676 | | - elseif($step == 5 and $text != $buttonValues['cancel'] && preg_match('/^planNetworkType(?<protocol>.+)_(?<tag>.*)/',$data,$match)){ |
| 6676 | + elseif($step == 5 and $text != $buttonValues['cancel'] && preg_match('/^planNetworkType(?<protocol>.+)\*_\*(?<tag>.*)/',$data,$match)){ |
6677 | 6677 | $saveBtn = "ذخیره ✅"; |
6678 | 6678 | if($markup[count($markup)-1][0]['text'] == $saveBtn) unset($markup[count($markup)-1]); |
6679 | 6679 |
|
|
6697 | 6697 | foreach($markup as $key=>$value){ |
6698 | 6698 | $tag = trim(str_replace("✅", "", $value[0]['text'], $state)); |
6699 | 6699 | if($state > 0){ |
6700 | | - preg_match('/^selectHost(?<protocol>.+)_(?<tag>.*)/',$value[0]['callback_data'],$info); |
| 6700 | + preg_match('/^planNetworkType(?<protocol>.+)\*_\*(?<tag>.*)/',$value[0]['callback_data'],$info); |
6701 | 6701 | $inbounds[$info['protocol']][] = $tag; |
6702 | 6702 | $proxies[$info['protocol']] = array(); |
6703 | 6703 |
|
|
0 commit comments