5 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ public function handleRequest(AphrontRequest $request) {
32
32
33
33
$ panel_ref = null ;
34
34
$ panel_key = $ request ->getStr ('panelKey ' );
35
- if (strlen ($ panel_key )) {
35
+ if (phutil_nonempty_string ($ panel_key )) {
36
36
$ panel_ref = $ ref_list ->getPanelRef ($ panel_key );
37
37
if (!$ panel_ref ) {
38
38
return new Aphront404Response ();
@@ -42,7 +42,7 @@ public function handleRequest(AphrontRequest $request) {
42
42
}
43
43
44
44
$ column_key = $ request ->getStr ('columnKey ' );
45
- if (strlen ($ column_key )) {
45
+ if (phutil_nonempty_string ($ column_key )) {
46
46
$ columns = $ ref_list ->getColumns ();
47
47
if (!isset ($ columns [$ column_key ])) {
48
48
return new Aphront404Response ();
@@ -52,7 +52,7 @@ public function handleRequest(AphrontRequest $request) {
52
52
53
53
$ after_ref = null ;
54
54
$ after_key = $ request ->getStr ('afterKey ' );
55
- if (strlen ($ after_key )) {
55
+ if (phutil_nonempty_string ($ after_key )) {
56
56
$ after_ref = $ ref_list ->getPanelRef ($ after_key );
57
57
if (!$ after_ref ) {
58
58
return new Aphront404Response ();
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ public function handleRequest(AphrontRequest $request) {
15
15
// editing.
16
16
17
17
$ context_phid = $ request ->getStr ('contextPHID ' );
18
- if (strlen ($ context_phid )) {
18
+ if (phutil_nonempty_string ($ context_phid )) {
19
19
$ context = id (new PhabricatorObjectQuery ())
20
20
->setViewer ($ viewer )
21
21
->withPHIDs (array ($ context_phid ))
Original file line number Diff line number Diff line change @@ -41,12 +41,12 @@ public function handleRequest(AphrontRequest $request) {
41
41
42
42
$ op = $ request ->getURIData ('op ' );
43
43
$ after = $ request ->getStr ('after ' );
44
- if (!strlen ($ after )) {
44
+ if (!phutil_nonempty_string ($ after )) {
45
45
$ after = null ;
46
46
}
47
47
48
48
$ target = $ request ->getStr ('target ' );
49
- if (!strlen ($ target )) {
49
+ if (!phutil_nonempty_string ($ target )) {
50
50
$ target = null ;
51
51
}
52
52
@@ -103,7 +103,7 @@ public function handleRequest(AphrontRequest $request) {
103
103
104
104
$ context_phid = $ request ->getStr ('contextPHID ' );
105
105
$ context = null ;
106
- if (strlen ($ context_phid )) {
106
+ if (phutil_nonempty_string ($ context_phid )) {
107
107
$ context = id (new PhabricatorObjectQuery ())
108
108
->setViewer ($ viewer )
109
109
->withPHIDs (array ($ context_phid ))
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ public function renderPanelContent(
101
101
$ subpanel = idx ($ panels , $ panel_id );
102
102
103
103
$ name = idx ($ tab_spec , 'name ' );
104
- if (!strlen ($ name )) {
104
+ if ($ name === null || !strlen ($ name )) {
105
105
if ($ subpanel ) {
106
106
$ name = $ subpanel ->getName ();
107
107
}
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ public function buildResults() {
28
28
$ query = new PhabricatorDashboardPanelQuery ();
29
29
30
30
$ raw_query = $ this ->getRawQuery ();
31
- if (preg_match ('/^[wW]\d+\z/ ' , $ raw_query )) {
31
+ if ($ raw_query !== null && preg_match ('/^[wW]\d+\z/ ' , $ raw_query )) {
32
32
$ id = trim ($ raw_query , 'wW ' );
33
33
$ id = (int )$ id ;
34
34
$ query ->withIDs (array ($ id ));
0 commit comments