Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP unserialize error at offset, works on some servers, not others
    primarykey
    data
    text
    <p>I have code that works on a handful of servers, but not others which is coming up with serialised data. I call a page like this:</p> <pre><code>http://domain/index.php/sales/Drilldowns?params=a:12:{s:13:"selectionType";s:8:"facility";s:8:"dateType";s:5:"daily";s:10:"dateOption";s:9:"drilldown";s:6:"metric";s:13:"bookingAmount";s:9:"companyFK";s:2:"11";s:10:"facilityFK";s:0:"";s:7:"classFK";s:0:"";s:15:"customDateStart";s:4:"null";s:7:"newDate";s:10:"2010-11-01";s:10:"metricName";s:10:"Bookings%20$";s:16:"currentDateRange";s:10:"11/01/2010";s:23:"currentMetricNavigation";s:8:"DELDELTE";}&amp;getExcel=0 </code></pre> <p>This is the code I'm using:</p> <pre><code>protected function getRequestVariables(){ if(isset($_REQUEST['params'])){ var_dump($_REQUEST['params']); echo 'length:'.strlen($_REQUEST['params']); $vars = unserialize($_REQUEST['params']); var_dump($vars); } else { $vars = $_REQUEST; // unset saved drilldown options $this-&gt;ci-&gt;session-&gt;svar_set('postVars', null); } </code></pre> <p>This is a <code>var_dump</code> output:</p> <pre><code>string(447) "a:12:{s:13:\"selectionType\";s:8:\"facility\";s:8:\"dateType\";s:5:\"daily\";s:10:\"dateOption\";s:9:\"drilldown\";s:6:\"metric\";s:13:\"bookingAmount\";s:9:\"companyFK\";s:2:\"11\";s:10:\"facilityFK\";s:0:\"\";s:7:\"classFK\";s:0:\"\";s:15:\"customDateStart\";s:4:\"null\";s:7:\"newDate\";s:10:\"2010-11-01\";s:10:\"metricName\";s:10:\"Bookings $\";s:16:\"currentDateRange\";s:10:\"11/01/2010\";s:23:\"currentMetricNavigation\";s:8:\"DELDELTE\";}" </code></pre> <p>When that gets processed I get the following error:</p> <blockquote> <p>A PHP Error was encountered<br> Severity: Notice Message: unserialize() [function.unserialize]: Error at offset 6 of 447 bytes<br> Filename: plugins/Drilldowns.php<br> Line Number: 93</p> </blockquote> <p>I'm trying this on 5.2.13 - works on some Linux, some OS X, not others. Have checked php.ini, charset (I think) - I can't figure it out for the life of me. I've tried things as simple as </p> <pre><code>string(18) "a:1:{s:3:\"sam\";}" length:18 </code></pre> <p>and it still errors. Any clue as to why?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload