Yii Framework Forum: GET and negative number weirdness - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

GET and negative number weirdness GET and negative number weirdness Rate Topic: -----

#1 User is offline   thinkt4nk 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 36
  • Joined: 19-September 10

Posted 22 October 2010 - 09:45 AM

I don't know if this is a general PHP issue or a Yii issue, but my GET string seems to be altered somewhere in the request. I send this path to the controller...

/calendarEntry/ajaxGetEvents/distance/5/lat/38.64699101577188/lon/-90.22496699999999?_=1287758285259&start=1285477200&end=1289106000

but, in my action, if I dump the GET string...
//first line in actionAjaxGetEvents()
CVarDumper::dump($_GET);


...I get the string, but the longitude drops the sign...

array
(
'_' => '1287758285259'
'start' => '1285477200'
'end' => '1289106000'
'distance' => '5'
'lat' => '38.64699101577188'
'lon' => '90.22496699999999'
)

Any ideas as to why this is happening?
0

#2 User is offline   thinkt4nk 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 36
  • Joined: 19-September 10

Posted 22 October 2010 - 10:00 AM

I'm an idiot. — to encode it properly.

::)
0

#3 User is offline   thinkt4nk 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 36
  • Joined: 19-September 10

Posted 22 October 2010 - 12:10 PM

That actually didn't do it, and neither did − If I tried to cast the number to double or float, it would convert to a zero value. I ended up having to evaluate the sign of the value in my javascript, prepend 'NEG' to the beginning of negative signed numbers in the GET string, then parse it all in my action. Weird stuff... Also, it wasn't my javascript creating a weird encoding of a minus sign; I typed it in by hand, and it still just dropped the sign. :blink:
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users