Jackie Posted June 22, 2012 Share Posted June 22, 2012 Hey, just a small problem When setting the SSID name to anything normal, eg "Test" Everything works fine But when adding a ' to the name, eg "Test's" It adds additional characters to the name Am I just doing something stupid here? Note, this also seems to happen for many other non-alphanumeric characters. Running a Wifi Pineapple IV on 2.3.1 Many Thanks Jack Quote Link to comment Share on other sites More sharing options...
Dazzle Posted June 22, 2012 Share Posted June 22, 2012 Because ' is used for other things in PHP it gets 'escaped'. Adding a backslash in front of a special character will make sure the character is used as text rather than part of the script. Hope that makes sense, kinda difficult to explain Is it also showing up like that when you scan for wireless networks using a other device? Quote Link to comment Share on other sites More sharing options...
Jackie Posted June 22, 2012 Author Share Posted June 22, 2012 Hey, Thanks for the reply I've already tried a bit of messing around with the backslashes (see attached) Just seems to make things worse D: Quote Link to comment Share on other sites More sharing options...
Dazzle Posted June 22, 2012 Share Posted June 22, 2012 (edited) I didn't mean you should put a backslash there, but that the script does it automatically, I just thought it would only show it like that in the web interface and still show the SSID correctly on other devices. It's probably a little bug in the PHP somewhere, I can't access a pineapple at the moment to test though, I'm sure Sebkinne will know what's exactly going on. I'll have a look at it myself tonight ---------------------------------------------- Using stripslashes() you might be able to achieve this, but that would mean you can't add a slash at all You could chnage the following code in config.php if(isset($_POST[newSSID])){ if(isset($_POST[newSSIDPersistent])){ exec("echo \"$(sed 's/option ssid.*/option ssid ".$_POST[newSSID]."/g' /etc/config/wireless)\" > /etc/config/wireless"); echo "Changes to SSID have been made persistently<br />"; } exec("hostapd_cli -p /var/run/hostapd-phy0 karma_change_ssid \"".$_POST[newSSID]."\""); echo "Karma SSID changed to \"".$_POST[newSSID]."\" successfully <br /><br />"; } to this $SSID = stripslashes($_POST[newSSID]); if(isset($_POST[newSSID])){ if(isset($_POST[newSSIDPersistent])){ exec("echo \"$(sed 's/option ssid.*/option ssid ".$SSID."/g' /etc/config/wireless)\" > /etc/config/wireless"); echo "Changes to SSID have been made persistently<br />"; } exec("hostapd_cli -p /var/run/hostapd-phy0 karma_change_ssid \"".$SSID."\""); echo "Karma SSID changed to \"".$SSID."\" successfully <br /><br />"; } Be aware that I'm unable to test this so make sure to make a backup of your config.php first This is just a quick fix that might solve your problem temporarily Dazzle Edited June 22, 2012 by Dazzle Quote Link to comment Share on other sites More sharing options...
Jackie Posted June 22, 2012 Author Share Posted June 22, 2012 Worked a charm Thank you Quote Link to comment Share on other sites More sharing options...
Dazzle Posted June 22, 2012 Share Posted June 22, 2012 You're welcome Great to see that it worked ;) Have fun with your pineapple now Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.