Jump to content

Special Characters Added In Ssid


Jackie

Recommended Posts

Hey, just a small problem

When setting the SSID name to anything normal, eg "Test" Everything works fine

post-40061-0-82275000-1340364701_thumb.p

But when adding a ' to the name, eg "Test's" It adds additional characters to the name

post-40061-0-82520600-1340364707_thumb.p

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

Link to comment
Share on other sites

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 :rolleyes:

Is it also showing up like that when you scan for wireless networks using a other device?

Link to comment
Share on other sites

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 by Dazzle
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...