Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7476304

Browse files
author
tobiasz.cudnik
committed
fixed strict warnings for ajax
1 parent 8101739 commit 7476304

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

phpQuery/phpQuery.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ public static function ajax($options = array(), $xhr = null) {
705705
}
706706
// JSONP
707707
$jsre = "/=\\?(&|$)/";
708-
if ($options['dataType'] == 'jsonp') {
708+
if (isset($options['dataType']) && $options['dataType'] == 'jsonp') {
709709
$jsonpCallbackParam = $options['jsonp']
710710
? $options['jsonp'] : 'callback';
711711
if (strtolower($options['type']) == 'get') {
@@ -726,7 +726,7 @@ public static function ajax($options = array(), $xhr = null) {
726726
}
727727
$options['dataType'] = 'json';
728728
}
729-
if ($options['dataType'] == 'json') {
729+
if (isset($options['dataType']) && $options['dataType'] == 'json') {
730730
$jsonpCallback = 'json_'.md5(microtime());
731731
$jsonpData = $jsonpUrl = false;
732732
if ($options['data']) {
@@ -835,11 +835,11 @@ public static function ajax($options = array(), $xhr = null) {
835835
// return new phpQueryAjaxResponse($response, $domId);
836836
}
837837
protected static function httpData($data, $type, $options) {
838-
if ($options['dataFilter'])
838+
if (isset($options['dataFilter']) && $options['dataFilter'])
839839
$data = self::callbackRun($options['dataFilter'], array($data, $type));
840840
if (is_string($data)) {
841841
if ($type == "json") {
842-
if ($options['_jsonp']) {
842+
if (isset($options['_jsonp']) && $options['_jsonp']) {
843843
$data = preg_replace('/^\s*\w+\((.*)\)\s*$/s', '$1', $data);
844844
}
845845
$data = self::parseJSON($data);

0 commit comments

Comments
 (0)